From 0136572fc48dd35e431b654db3fd3140ae44f585 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 25 Jul 2025 16:36:17 -0400 Subject: [PATCH] Code formatting --- src/callers/song.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/callers/song.rs b/src/callers/song.rs index 1656668..a92109b 100644 --- a/src/callers/song.rs +++ b/src/callers/song.rs @@ -994,18 +994,16 @@ pub mod endpoint { let mut response = super::response::get_songs::Response::default(); match params.id { - Some(id) => { - match super::song_db::get_song(&pool, &id).await { - Ok(song) => { - response.data.push(song); - (axum::http::StatusCode::OK, axum::Json(response)) - } - Err(err) => { - response.message = err.to_string(); - (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) - } + Some(id) => match super::song_db::get_song(&pool, &id).await { + Ok(song) => { + response.data.push(song); + (axum::http::StatusCode::OK, axum::Json(response)) } - } + Err(err) => { + response.message = err.to_string(); + (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) + } + }, None => { response.message = String::from("Invalid parameters"); (axum::http::StatusCode::BAD_REQUEST, axum::Json(response))