From 2f8ddf075487bde42f8b2eaff9d836c535931f87 Mon Sep 17 00:00:00 2001 From: Mitchell Marino Date: Sun, 16 Apr 2023 16:09:50 -0500 Subject: [PATCH] clippy --- src/models.rs | 4 ++-- src/user.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/models.rs b/src/models.rs index e8e8dd7..70f3f80 100644 --- a/src/models.rs +++ b/src/models.rs @@ -218,7 +218,7 @@ mod serde_datetime { deserializer: D, ) -> Result { let str = ::deserialize(deserializer)?; - NaiveDateTime::from_str(&str).map_err(|err| serde::de::Error::custom(err)) + NaiveDateTime::from_str(&str).map_err(serde::de::Error::custom) } } @@ -236,6 +236,6 @@ mod serde_big_decimal { pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result { let float = f32::deserialize(deserializer)?; - BigDecimal::try_from(float).map_err(|err| serde::de::Error::custom(err)) + BigDecimal::try_from(float).map_err(serde::de::Error::custom) } } diff --git a/src/user.rs b/src/user.rs index 4a05be0..71cc6bd 100644 --- a/src/user.rs +++ b/src/user.rs @@ -99,10 +99,10 @@ pub async fn signin( } }; - return (StatusCode::OK, Json(json!({ "data": token }))); + (StatusCode::OK, Json(json!({ "data": token }))) } Ok(None) => { - return ( + ( StatusCode::UNAUTHORIZED, Json(json!({ "error": format!("Incorrect username or password") @@ -110,7 +110,7 @@ pub async fn signin( ) } Err(err) => { - return ( + ( StatusCode::INTERNAL_SERVER_ERROR, Json(json!({ "error": format!("Unknown error signing in: {:?}", err)