Skip to content

Commit

Permalink
Merge pull request #1539 from tmccombs/fix-clippy
Browse files Browse the repository at this point in the history
Fix deprecation warning.
  • Loading branch information
tavianator committed Apr 28, 2024
2 parents 85cbea8 + 7e5d14b commit ae1de4d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/filter/time.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::{DateTime, Local, NaiveDate, NaiveDateTime, Utc};
use chrono::{DateTime, Local, NaiveDate, NaiveDateTime};

use std::time::SystemTime;

Expand Down Expand Up @@ -33,10 +33,7 @@ impl TimeFilter {
})
.or_else(|| {
let timestamp_secs = s.strip_prefix('@')?.parse().ok()?;
NaiveDateTime::from_timestamp_opt(timestamp_secs, 0)?
.and_local_timezone(Utc)
.latest()
.map(Into::into)
DateTime::from_timestamp(timestamp_secs, 0).map(Into::into)
})
.map(|dt| dt.into())
})
Expand Down

0 comments on commit ae1de4d

Please sign in to comment.