From 713bce5769d604257684438ea59690bf7678818a Mon Sep 17 00:00:00 2001 From: micwoj92 <45581170+micwoj92@users.noreply.github.com> Date: Tue, 21 Mar 2023 22:20:21 +0100 Subject: Fix deprecation warning Chrono 0.4.23 deprecated methods that have an _opt() alternative. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d4f7f1e..a523b4c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,7 @@ async fn get_feed(feed_conf: &FeedConf) -> bool { let last_fetch_time; match &feed_conf.last_fetch { Some(x) => last_fetch_time = DateTime::from_utc( - NaiveDateTime::from_timestamp(x.to_owned(),0), Utc), + NaiveDateTime::from_timestamp_opt(x.to_owned(),0).unwrap(), Utc), None => last_fetch_time = Utc::now(), } debug!("Using last_fetch_time {:?}", last_fetch_time.to_owned()); -- cgit v1.2.3