Skip to content

Commit

Permalink
cargo_fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidharth-Singh10 committed Oct 1, 2024
1 parent b6099e0 commit 4d904de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/handlers/auth_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ pub async fn signup_handler(
.unwrap();

if let Some(_) = created_user {
Ok(StatusCode::ACCEPTED)
Ok(StatusCode::ACCEPTED)
} else {
Err(StatusCode::INTERNAL_SERVER_ERROR)
Err(StatusCode::INTERNAL_SERVER_ERROR)
}
}
Err(e) => {
eprintln!("Failed to insert user into the database: {}", e);
Err(StatusCode::INTERNAL_SERVER_ERROR)
Err(StatusCode::INTERNAL_SERVER_ERROR)
}
}
}
Expand Down Expand Up @@ -314,15 +314,15 @@ pub async fn new_password_handler(
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;

Ok(Json("Password updated successfully".to_string()))
Ok(Json("Password updated successfully".to_string()))
} else {
// Token not found
txn.rollback().await.unwrap();
Err(StatusCode::BAD_REQUEST)
Err(StatusCode::BAD_REQUEST)
}
} else {
// One or both are missing
Err(StatusCode::BAD_REQUEST)
Err(StatusCode::BAD_REQUEST)
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/handlers/cp_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ use tokio::fs::{create_dir_all, File};
use tokio::io::AsyncWriteExt;

use crate::utils::scripts::{compare_with_answer_file, docker_run};
pub fn code_handler(
mut multipart: Multipart,
) -> Result<Json<String>, StatusCode> {

pub fn code_handler(mut multipart: Multipart) -> Result<Json<String>, StatusCode> {
todo!();
// while let Some(field) = multipart.next_field().await.unwrap() {
// let filename = field
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/crud_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ pub async fn reject_handler(
.await;

if let Err(_) = flag_update_result {
(
(
StatusCode::INTERNAL_SERVER_ERROR,
Json("Failed to update flags to 0"),
)
Expand Down

0 comments on commit 4d904de

Please sign in to comment.