Skip to content

Commit

Permalink
Replace deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
pkolaczk committed Jun 21, 2024
1 parent 4887412 commit 206d6ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::num::NonZeroUsize;
use std::path::Path;
use std::{fs, io};

use chrono::{Local, NaiveDateTime, TimeZone};
use chrono::{Local, TimeZone};
use console::{pad_str, style, Alignment};
use err_derive::*;
use itertools::Itertools;
Expand Down Expand Up @@ -438,8 +438,10 @@ impl RunConfigCmp<'_> {
fn format_time(&self, conf: &RunCommand, format: &str) -> String {
conf.timestamp
.and_then(|ts| {
NaiveDateTime::from_timestamp_opt(ts, 0)
.map(|utc| Local.from_utc_datetime(&utc).format(format).to_string())
Local
.timestamp_opt(ts, 0)
.latest()
.map(|l| l.format(format).to_string())
})
.unwrap_or_default()
}
Expand Down

0 comments on commit 206d6ee

Please sign in to comment.