Run formatting (#1202)
This commit is contained in:
parent
340b9d8a2b
commit
dead8f3645
2 changed files with 9 additions and 3 deletions
|
@ -112,8 +112,12 @@ pub fn get_current_dir() -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_days_from_month(year: i32, month: u32) -> i64 {
|
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(start) = NaiveDate::from_ymd_opt(year, month, 1) else {
|
||||||
let Some(end) = start.checked_add_months(Months::new(1)) else { return 30 };
|
return 30;
|
||||||
|
};
|
||||||
|
let Some(end) = start.checked_add_months(Months::new(1)) else {
|
||||||
|
return 30;
|
||||||
|
};
|
||||||
end.signed_duration_since(start).num_days()
|
end.signed_duration_since(start).num_days()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,9 @@ use atuin_common::api::*;
|
||||||
|
|
||||||
pub fn verify_str(hash: &str, password: &str) -> bool {
|
pub fn verify_str(hash: &str, password: &str) -> bool {
|
||||||
let arg2 = Argon2::new(Algorithm::Argon2id, Version::V0x13, Params::default());
|
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()
|
arg2.verify_password(password.as_bytes(), &hash).is_ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue