From 4d904debbc98b8dce6c49e36d04aa940bbe4e86d Mon Sep 17 00:00:00 2001 From: Sidharth-Singh10 Date: Tue, 1 Oct 2024 21:47:07 +0530 Subject: [PATCH] cargo_fmt --- src/handlers/auth_handlers.rs | 12 ++++++------ src/handlers/cp_handler.rs | 5 +---- src/handlers/crud_handlers.rs | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/handlers/auth_handlers.rs b/src/handlers/auth_handlers.rs index f92b69e..9b0af42 100644 --- a/src/handlers/auth_handlers.rs +++ b/src/handlers/auth_handlers.rs @@ -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) } } } @@ -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) } } diff --git a/src/handlers/cp_handler.rs b/src/handlers/cp_handler.rs index b99c84f..ca6ab74 100644 --- a/src/handlers/cp_handler.rs +++ b/src/handlers/cp_handler.rs @@ -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, StatusCode> { - +pub fn code_handler(mut multipart: Multipart) -> Result, StatusCode> { todo!(); // while let Some(field) = multipart.next_field().await.unwrap() { // let filename = field diff --git a/src/handlers/crud_handlers.rs b/src/handlers/crud_handlers.rs index 5fed92c..f9b18b4 100644 --- a/src/handlers/crud_handlers.rs +++ b/src/handlers/crud_handlers.rs @@ -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"), )