Linter: remove deprecated calls

This commit is contained in:
Matteo Settenvini 2023-02-03 15:08:24 +01:00
parent 4fbbbf6091
commit 6bed919b9e
Signed by: matteo
GPG Key ID: 8576CC1AD97D42DF
2 changed files with 3 additions and 3 deletions

View File

@ -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());

View File

@ -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);