From dead8f364528bd2ea2ac6a85164cdcd66508aa4d Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 30 Aug 2023 22:37:15 +0100 Subject: [PATCH] Run formatting (#1202) --- atuin-common/src/utils.rs | 8 ++++++-- atuin-server/src/handlers/user.rs | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/atuin-common/src/utils.rs b/atuin-common/src/utils.rs index d2db3ac..ed98e27 100644 --- a/atuin-common/src/utils.rs +++ b/atuin-common/src/utils.rs @@ -112,8 +112,12 @@ pub fn get_current_dir() -> String { } pub fn get_days_from_month(year: i32, month: u32) -> i64 { - let Some(start) = NaiveDate::from_ymd_opt(year, month, 1) else { return 30 }; - let Some(end) = start.checked_add_months(Months::new(1)) else { return 30 }; + let Some(start) = NaiveDate::from_ymd_opt(year, month, 1) else { + return 30; + }; + let Some(end) = start.checked_add_months(Months::new(1)) else { + return 30; + }; end.signed_duration_since(start).num_days() } diff --git a/atuin-server/src/handlers/user.rs b/atuin-server/src/handlers/user.rs index 7508115..4f2ad89 100644 --- a/atuin-server/src/handlers/user.rs +++ b/atuin-server/src/handlers/user.rs @@ -28,7 +28,9 @@ use atuin_common::api::*; pub fn verify_str(hash: &str, password: &str) -> bool { let arg2 = Argon2::new(Algorithm::Argon2id, Version::V0x13, Params::default()); - let Ok(hash) = PasswordHash::new(hash) else { return false }; + let Ok(hash) = PasswordHash::new(hash) else { + return false; + }; arg2.verify_password(password.as_bytes(), &hash).is_ok() }