diff --git a/src/commands/groceries.rs b/src/commands/groceries.rs index 7a683b0..f9c28e2 100644 --- a/src/commands/groceries.rs +++ b/src/commands/groceries.rs @@ -24,7 +24,7 @@ pub async fn with( use chrono::{NaiveDateTime, NaiveTime, TimeZone}; let start = start_date .map(|d| { - let day_start = NaiveDateTime::new(d, NaiveTime::from_hms(0, 0, 0)); + let day_start = NaiveDateTime::new(d, NaiveTime::from_hms_opt(0, 0, 0).unwrap()); Local.from_local_datetime(&day_start).unwrap() }) .unwrap_or_else(|| Local::now()); diff --git a/src/scheduling.rs b/src/scheduling.rs index cdfc219..ac872e3 100644 --- a/src/scheduling.rs +++ b/src/scheduling.rs @@ -30,8 +30,8 @@ impl Scheduling { ); let meal_time = match meal { - Meal::Lunch => NaiveTime::from_hms(12, 00, 00), - Meal::Dinner => NaiveTime::from_hms(19, 00, 00), + Meal::Lunch => NaiveTime::from_hms_opt(12, 00, 00).unwrap(), + Meal::Dinner => NaiveTime::from_hms_opt(19, 00, 00).unwrap(), }; let ends_at = NaiveDateTime::new(date, meal_time);