Skip to content

Commit

Permalink
avoid excess Cache::default() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
esheppa committed Jul 8, 2022
1 parent 6c7943d commit 8258ff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/offset/local/unix.rs
Expand Up @@ -21,7 +21,7 @@ pub(super) fn now() -> DateTime<Local> {

pub(super) fn naive_to_local(d: &NaiveDateTime, local: bool) -> LocalResult<DateTime<Local>> {
TZ_INFO.with(|maybe_cache| {
maybe_cache.borrow_mut().get_or_insert(Cache::default()).offset(*d, local)
maybe_cache.borrow_mut().get_or_insert_with(Cache::default).offset(*d, local)
})
}

Expand Down

0 comments on commit 8258ff9

Please sign in to comment.