Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Dec 4, 2024
1 parent 06e1fa2 commit d9aed7f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ fn format_system_time(time: SystemTime) -> String {
let datetime = time.duration_since(UNIX_EPOCH).unwrap();
let seconds = datetime.as_secs();
let nanos = datetime.subsec_nanos();
let naive = chrono::NaiveDateTime::from_timestamp(seconds as i64, nanos);
let datetime: chrono::DateTime<chrono::Utc> = chrono::DateTime::from_utc(naive, chrono::Utc);
datetime.format("%Y-%m-%d %H:%M:%S").to_string()
let naive = chrono::DateTime::from_timestamp(seconds.try_into().unwrap(), nanos).unwrap();
naive.format("%Y-%m-%d %H:%M:%S").to_string()
}

#[tokio::main(flavor = "multi_thread")]
Expand Down

0 comments on commit d9aed7f

Please sign in to comment.