Warning fixes
All checks were successful
Rust Build / Check (pull_request) Successful in 59s
Rust Build / Test Suite (pull_request) Successful in 59s
Rust Build / Rustfmt (pull_request) Successful in 35s
Rust Build / Clippy (pull_request) Successful in 57s
Rust Build / build (pull_request) Successful in 1m29s
All checks were successful
Rust Build / Check (pull_request) Successful in 59s
Rust Build / Test Suite (pull_request) Successful in 59s
Rust Build / Rustfmt (pull_request) Successful in 35s
Rust Build / Clippy (pull_request) Successful in 57s
Rust Build / build (pull_request) Successful in 1m29s
This commit is contained in:
@@ -53,13 +53,13 @@ pub async fn register_user(
|
|||||||
match repo::user::exists(&pool, &user.username).await {
|
match repo::user::exists(&pool, &user.username).await {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
if res {
|
if res {
|
||||||
return (
|
(
|
||||||
StatusCode::NOT_FOUND,
|
StatusCode::NOT_FOUND,
|
||||||
Json(response::Response {
|
Json(response::Response {
|
||||||
message: String::from("Error"),
|
message: String::from("Error"),
|
||||||
data: vec![user],
|
data: vec![user],
|
||||||
}),
|
}),
|
||||||
);
|
)
|
||||||
} else {
|
} else {
|
||||||
match repo::user::insert(&pool, &user).await {
|
match repo::user::insert(&pool, &user).await {
|
||||||
Ok(id) => {
|
Ok(id) => {
|
||||||
|
@@ -13,7 +13,7 @@ pub mod user {
|
|||||||
SELECT 1 FROM "user" WHERE username = $1
|
SELECT 1 FROM "user" WHERE username = $1
|
||||||
"#,
|
"#,
|
||||||
)
|
)
|
||||||
.bind(&username)
|
.bind(username)
|
||||||
.fetch_optional(pool)
|
.fetch_optional(pool)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user