tsk-61: code formatting
Some checks failed
Rust Build / Check (pull_request) Successful in 40s
Rust Build / Test Suite (pull_request) Failing after 1m25s
Rust Build / Rustfmt (pull_request) Successful in 30s
Rust Build / Clippy (pull_request) Successful in 39s
Rust Build / build (pull_request) Successful in 58s

This commit is contained in:
2025-10-20 12:33:11 -04:00
parent 3db7bc330b
commit 6ee2db43d2

View File

@@ -53,15 +53,16 @@ pub async fn register_user(
Json(payload): Json<request::Request>,
) -> (StatusCode, Json<response::Response>) {
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<bool, std::io::Error> {
} 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",
))
}
}