From 74df5d1d3c55856c0b1a37a132e954c0dd65d1fd Mon Sep 17 00:00:00 2001 From: Ronald Holshausen Date: Wed, 11 Dec 2024 15:45:10 +1100 Subject: [PATCH] fix: Remove duplicated timezone entries from timezone_db --- rust/pact_models/build.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/pact_models/build.rs b/rust/pact_models/build.rs index 7f615537..27aefad0 100644 --- a/rust/pact_models/build.rs +++ b/rust/pact_models/build.rs @@ -8,7 +8,7 @@ use std::{io, env}; use std::fs; use std::fs::File; use std::io::{BufRead, BufReader, Write}; -use std::collections::BTreeSet; +use std::collections::{BTreeSet, HashSet}; use std::collections::hash_map::Entry; use maplit::*; use std::collections::HashMap; @@ -56,13 +56,13 @@ fn main() -> io::Result<()> { writeln!(timezone_db_file, " );")?; writeln!(timezone_db_file, " pub static ref ZONES_ABBR: HashMap<&'static str, Vec<&'static str>> = hashmap!(")?; - let mut abbr : HashMap> = hashmap!{}; + let mut abbr : HashMap> = hashmap!{}; for zone in &zones { let timespans = table.timespans(zone).unwrap().rest; for (_, timespan) in timespans { match abbr.entry(timespan.name) { - Entry::Vacant(e) => { e.insert(vec![zone.to_string()]); }, - Entry::Occupied(mut e) => e.get_mut().push(zone.to_string()) + Entry::Vacant(e) => { e.insert(hashset![zone.to_string()]); }, + Entry::Occupied(mut e) => { e.get_mut().insert(zone.to_string()); } } } }