From 58085158539bb45ee425b0a47e4b1a0fd71bfc15 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Mon, 4 Sep 2023 09:48:37 +0200 Subject: [PATCH] fix warnings --- src/components/utils/logitems.rs | 10 ++++++---- src/components/utils/mod.rs | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/utils/logitems.rs b/src/components/utils/logitems.rs index cbf3c6ff..12d72862 100644 --- a/src/components/utils/logitems.rs +++ b/src/components/utils/logitems.rs @@ -31,10 +31,12 @@ impl From for LogEntry { if date.is_none() { log::error!("error reading commit date: {hash_short} - timestamp: {}",c.time); } - DateTime::::from(DateTime::::from_utc( - date.unwrap_or_default(), - Utc, - )) + DateTime::::from( + DateTime::::from_naive_utc_and_offset( + date.unwrap_or_default(), + Utc, + ), + ) }; let author = c.author; diff --git a/src/components/utils/mod.rs b/src/components/utils/mod.rs index f70397b5..7d32a40f 100644 --- a/src/components/utils/mod.rs +++ b/src/components/utils/mod.rs @@ -28,11 +28,13 @@ macro_rules! try_or_popup { /// helper func to convert unix time since epoch to formated time string in local timezone pub fn time_to_string(secs: i64, short: bool) -> String { - let time = DateTime::::from(DateTime::::from_utc( - NaiveDateTime::from_timestamp_opt(secs, 0) - .unwrap_or_default(), - Utc, - )); + let time = DateTime::::from( + DateTime::::from_naive_utc_and_offset( + NaiveDateTime::from_timestamp_opt(secs, 0) + .unwrap_or_default(), + Utc, + ), + ); time.format(if short { "%Y-%m-%d"