From e1fd71dafa972213645c33b3cf44d0b1d10a59d9 Mon Sep 17 00:00:00 2001 From: simonhammes Date: Sun, 26 May 2024 14:11:04 +0200 Subject: [PATCH] DateTime::from_utc() is deprecated --- src/main.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 96ad14a..b3a80e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use chrono::{DateTime, Datelike, Days, NaiveDate, NaiveTime, Utc, Weekday}; +use chrono::{DateTime, Datelike, Days, NaiveDate, NaiveTime, Weekday}; use futures::future::join_all; use std::collections::BTreeMap; use std::time::Duration; @@ -7,12 +7,10 @@ use std::time::Duration; async fn main() { println!("Hello, world!"); - let start = DateTime::::from_utc( - NaiveDate::from_isoywd_opt(2023, 1, Weekday::Mon) - .unwrap() - .and_time(NaiveTime::from_hms_opt(0, 0, 0).unwrap()), - Utc, - ); + let start = NaiveDate::from_isoywd_opt(2023, 1, Weekday::Mon) + .unwrap() + .and_time(NaiveTime::from_hms_opt(0, 0, 0).unwrap()) + .and_utc(); let dates: Vec = vec![ start, start + Days::new(1),