From 6ee2db43d286dc7bc418d4663f76a40620c21a98 Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 20 Oct 2025 12:33:11 -0400 Subject: [PATCH] tsk-61: code formatting --- src/callers/register.rs | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/callers/register.rs b/src/callers/register.rs index 2f58e06..990fbe6 100644 --- a/src/callers/register.rs +++ b/src/callers/register.rs @@ -53,15 +53,16 @@ pub async fn register_user( Json(payload): Json, ) -> (StatusCode, Json) { let registration_enabled = match is_registration_enabled().await { - Ok(value) => { - value - } + Ok(value) => value, Err(err) => { eprintln!("Error: {err:?}"); - return (axum::http::StatusCode::INTERNAL_SERVER_ERROR, Json(response::Response{ - message: String::from("Registration check failed"), - data: Vec::new() - })); + return ( + axum::http::StatusCode::INTERNAL_SERVER_ERROR, + Json(response::Response { + message: String::from("Registration check failed"), + data: Vec::new(), + }), + ); } }; @@ -130,10 +131,13 @@ pub async fn register_user( ), } } else { - (axum::http::StatusCode::NOT_ACCEPTABLE, Json(response::Response{ - message: String::from("Registration is not enabled"), - data: Vec::new() - })) + ( + axum::http::StatusCode::NOT_ACCEPTABLE, + Json(response::Response { + message: String::from("Registration is not enabled"), + data: Vec::new(), + }), + ) } } @@ -148,6 +152,8 @@ async fn is_registration_enabled() -> Result { } else if parsed_value == "FALSE" { Ok(false) } else { - Err(std::io::Error::other("Could not determine value of ENABLE_REGISTRATION")) + Err(std::io::Error::other( + "Could not determine value of ENABLE_REGISTRATION", + )) } }