Skip to content

Commit

Permalink
don't use ZeroMap2d
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Oct 30, 2024
1 parent 88a1a54 commit dd78c5b
Show file tree
Hide file tree
Showing 6 changed files with 742 additions and 742 deletions.
4 changes: 2 additions & 2 deletions components/datetime/src/provider/time_zones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ pub struct MetazoneGenericNamesV1<'data> {
pub struct MetazoneSpecificNamesV1<'data> {
/// The default mapping between metazone id and localized metazone name.
#[cfg_attr(feature = "serde", serde(borrow))]
pub defaults: ZeroMap2d<'data, MetazoneId, ZoneVariant, str>,
pub defaults: ZeroMap<'data, (MetazoneId, ZoneVariant), str>,
/// The override mapping between timezone id and localized metazone name.
#[cfg_attr(feature = "serde", serde(borrow))]
pub overrides: ZeroMap2d<'data, TimeZoneBcp47Id, ZoneVariant, str>,
pub overrides: ZeroMap<'data, (TimeZoneBcp47Id, ZoneVariant), str>,
}

/// Metazone ID in a compact format
Expand Down
4 changes: 2 additions & 2 deletions components/datetime/src/time_zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ impl FormatTimeZone for SpecificNonLocationFormat {
let Some(name) = metazone(time_zone_id, local_time, metazone_period).and_then(|mz| {
names
.overrides
.get_2d(&time_zone_id, &zone_variant)
.or_else(|| names.defaults.get_2d(&mz, &zone_variant))
.get(&(time_zone_id, zone_variant))
.or_else(|| names.defaults.get(&(mz, zone_variant)))
}) else {
return Ok(Err(FormatTimeZoneError::Fallback));
};
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit dd78c5b

Please sign in to comment.