Skip to content

Commit

Permalink
1.32 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
esheppa committed Jul 7, 2022
1 parent 90bcb39 commit 6c7943d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/offset/local/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Default for Source {
// otherwise the behaivour here would be different
// to that in `naive_to_local`
match env::var_os("TZ") {
Some(s) if s.to_str().is_some() => Source::Environment,
Some(ref s) if s.to_str().is_some() => Source::Environment,
Some(_) | None => Source::LocalTime {
mtime: fs::symlink_metadata("/etc/localtime")
.expect("localtime should exist")
Expand All @@ -63,7 +63,7 @@ impl Source {
let now = SystemTime::now();
let prev = match self {
Source::LocalTime { mtime, last_checked } => match now.duration_since(*last_checked) {
Ok(d) if d.as_millis() < 1_000 => return false,
Ok(d) if d.as_secs() < 1 => return false,
Ok(_) | Err(_) => *mtime,
},
Source::Environment => return false,
Expand Down

0 comments on commit 6c7943d

Please sign in to comment.