Linter: remove deprecated calls
This commit is contained in:
parent
4fbbbf6091
commit
6bed919b9e
|
@ -24,7 +24,7 @@ pub async fn with(
|
||||||
use chrono::{NaiveDateTime, NaiveTime, TimeZone};
|
use chrono::{NaiveDateTime, NaiveTime, TimeZone};
|
||||||
let start = start_date
|
let start = start_date
|
||||||
.map(|d| {
|
.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()
|
Local.from_local_datetime(&day_start).unwrap()
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| Local::now());
|
.unwrap_or_else(|| Local::now());
|
||||||
|
|
|
@ -30,8 +30,8 @@ impl Scheduling {
|
||||||
);
|
);
|
||||||
|
|
||||||
let meal_time = match meal {
|
let meal_time = match meal {
|
||||||
Meal::Lunch => NaiveTime::from_hms(12, 00, 00),
|
Meal::Lunch => NaiveTime::from_hms_opt(12, 00, 00).unwrap(),
|
||||||
Meal::Dinner => NaiveTime::from_hms(19, 00, 00),
|
Meal::Dinner => NaiveTime::from_hms_opt(19, 00, 00).unwrap(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let ends_at = NaiveDateTime::new(date, meal_time);
|
let ends_at = NaiveDateTime::new(date, meal_time);
|
||||||
|
|
Loading…
Reference in New Issue