Skip to content

Commit

Permalink
Rename Cache to CachedTzInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Mar 20, 2024
1 parent a88603e commit 74271d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/offset/local/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ pub(super) fn offset_from_local_datetime(local: &NaiveDateTime) -> MappedLocalTi
})
}

struct Cache {
struct CachedTzInfo {
zone: Option<TimeZone>,
source: Source,
last_checked: SystemTime,
}

impl Cache {
impl CachedTzInfo {
fn tz_info(&mut self) -> &TimeZone {
self.refresh_cache();
self.zone.as_ref().unwrap()
Expand Down Expand Up @@ -200,8 +200,8 @@ impl Cache {
}

thread_local! {
static TZ_INFO: RefCell<Cache> = const { RefCell::new(
Cache {
static TZ_INFO: RefCell<CachedTzInfo> = const { RefCell::new(
CachedTzInfo {
zone: None,
source: Source::Uninitialized,
last_checked: SystemTime::UNIX_EPOCH,
Expand Down

0 comments on commit 74271d4

Please sign in to comment.