Deprecated usage 1 fixed

This commit is contained in:
Ellie Huxtable 2022-12-18 18:27:20 +00:00
parent 40d880a877
commit 64556d6dce

View File

@ -29,7 +29,7 @@ pub fn data_dir() -> PathBuf {
}
pub fn get_days_from_month(year: i32, month: u32) -> i64 {
NaiveDate::from_ymd(
NaiveDate::from_ymd_opt(
match month {
12 => year + 1,
_ => year,
@ -40,7 +40,8 @@ pub fn get_days_from_month(year: i32, month: u32) -> i64 {
},
1,
)
.signed_duration_since(NaiveDate::from_ymd(year, month, 1))
.expect("Invalid month")
.signed_duration_since(NaiveDate::from_ymd_opt(year, month, 1).expect("Invalid month"))
.num_days()
}