diff --git a/Cargo.toml b/Cargo.toml index 31a4720..987003e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -225,3 +225,10 @@ VE = [] VN = [] ZM = [] ZW = [] + +[lints.rust] +unsafe_code = "forbid" + +[lints.clippy] +enum_glob_use = "forbid" +pedantic = { level = "deny", priority = -1 } diff --git a/examples/subdivisions.rs b/examples/subdivisions.rs new file mode 100644 index 0000000..861ed87 --- /dev/null +++ b/examples/subdivisions.rs @@ -0,0 +1,22 @@ +use std::ops::Not; + +use chrono::NaiveDate; +use holidays::Country; + +fn main() -> anyhow::Result<()> { + // Building a subdivision will load the holidays of the main country and the subdivision. + holidays::Builder::new() + .countries(&[Country::US_WV]) + .years(2024..2025) + .init()?; + + let d = NaiveDate::from_ymd_opt(2024, 6, 20).expect("Invalid date"); + assert!(holidays::contains(Country::US, d)?.not()); + println!("{d} is not a holiday in the US."); + + assert!(holidays::contains(Country::US_WV, d)?); + println!("{d} is a holiday in West Virginia."); + println!("{:?}", holidays::get(Country::US_WV, d)?.unwrap()); + + Ok(()) +} diff --git a/gen.py b/gen.py index 6c67adf..fb5ac48 100644 --- a/gen.py +++ b/gen.py @@ -7,7 +7,8 @@ class Country: code: str name: str - + subdivision_code: str | None = None + subdivision_name: str | None = None countries = [ Country("AO", "Angola"), @@ -45,6 +46,23 @@ class Country: Country("FR", "France"), Country("GE", "Georgia"), Country("DE", "Germany"), + Country("DE", "Germany", "BB", "Brandenburg"), + Country("DE", "Germany", "BE", "Berlin"), + Country("DE", "Germany", "BW", "Baden-Württemberg"), + Country("DE", "Germany", "BY", "Bavaria (Bayern)"), + Country("DE", "Germany", "BYP", "Bavaria (Bayern) with more protestants"), + Country("DE", "Germany", "HB", "Bremen"), + Country("DE", "Germany", "HE", "Hesse (Hessen)"), + Country("DE", "Germany", "HH", "Hamburg"), + Country("DE", "Germany", "MV", "Mecklenburg-Vorpommern"), + Country("DE", "Germany", "NI", "Lower Saxony (Niedersachsen)"), + Country("DE", "Germany", "NW", "North Rhine-Westphalia (Nordrhein-Westfalen)"), + Country("DE", "Germany", "RP", "Rhineland-Palatinate (Rheinland-Pfalz)"), + Country("DE", "Germany", "SH", "Schleswig-Holstein"), + Country("DE", "Germany", "SL", "Saarland"), + Country("DE", "Germany", "SN", "Saxony (Sachsen)"), + Country("DE", "Germany", "ST", "Saxony-Anhalt (Sachsen-Anhalt)"), + Country("DE", "Germany", "TH", "Thuringia (Thüringen)"), Country("GR", "Greece"), Country("HN", "Honduras"), Country("HK", "Hong Kong"), @@ -105,6 +123,63 @@ class Country: Country("AE", "United Arab Emirates"), Country("GB", "United Kingdom"), Country("US", "United States"), + Country("US", "United States", "AK", "Alaska"), + Country("US", "United States", "AL", "Alabama"), + Country("US", "United States", "AR", "Arkansas"), + Country("US", "United States", "AS", "American Samoa"), + Country("US", "United States", "AZ", "Arizona"), + Country("US", "United States", "CA", "California"), + Country("US", "United States", "CO", "Colorado"), + Country("US", "United States", "CT", "Connecticut"), + Country("US", "United States", "DC", "District of Columbia"), + Country("US", "United States", "DE", "Delaware"), + Country("US", "United States", "FL", "Florida"), + Country("US", "United States", "GA", "Georgia"), + Country("US", "United States", "GU", "Guam"), + Country("US", "United States", "HI", "Hawaii"), + Country("US", "United States", "IA", "Iowa"), + Country("US", "United States", "ID", "Idaho"), + Country("US", "United States", "IL", "Illinois"), + Country("US", "United States", "IN", "Indiana"), + Country("US", "United States", "KS", "Kansas"), + Country("US", "United States", "KY", "Kentucky"), + Country("US", "United States", "LA", "Louisiana"), + Country("US", "United States", "MA", "Massachusetts"), + Country("US", "United States", "MD", "Maryland"), + Country("US", "United States", "ME", "Maine"), + Country("US", "United States", "MI", "Michigan"), + Country("US", "United States", "MN", "Minnesota"), + Country("US", "United States", "MO", "Missouri"), + Country("US", "United States", "MP", "Northern Mariana Islands"), + Country("US", "United States", "MS", "Mississippi"), + Country("US", "United States", "MT", "Montana"), + Country("US", "United States", "NC", "North Carolina"), + Country("US", "United States", "ND", "North Dakota"), + Country("US", "United States", "NE", "Nebraska"), + Country("US", "United States", "NH", "New Hampshire"), + Country("US", "United States", "NJ", "New Jersey"), + Country("US", "United States", "NM", "New Mexico"), + Country("US", "United States", "NV", "Nevada"), + Country("US", "United States", "NY", "New York"), + Country("US", "United States", "OH", "Ohio"), + Country("US", "United States", "OK", "Oklahoma"), + Country("US", "United States", "OR", "Oregon"), + Country("US", "United States", "PA", "Pennsylvania"), + Country("US", "United States", "PR", "Puerto Rico"), + Country("US", "United States", "RI", "Rhode Island"), + Country("US", "United States", "SC", "South Carolina"), + Country("US", "United States", "SD", "South Dakota"), + Country("US", "United States", "TN", "Tennessee"), + Country("US", "United States", "TX", "Texas"), + Country("US", "United States", "UM", "United States Minor Outlying Islands"), + Country("US", "United States", "UT", "Utah"), + Country("US", "United States", "VA", "Virginia"), + Country("US", "United States", "VI", "Virgin Islands, U.S.."), + Country("US", "United States", "VT", "Vermont"), + Country("US", "United States", "WA", "Washington"), + Country("US", "United States", "WI", "Wisconsin"), + Country("US", "United States", "WV", "West Virginia"), + Country("US", "United States", "WY", "Wyoming"), Country("UY", "Uruguay"), Country("UZ", "Uzbekistan"), Country("VE", "Venezuela"), @@ -120,12 +195,13 @@ class Country: /// Two-letter country codes defined in ISO 3166-1 alpha-2 . #[allow(dead_code)] +#[allow(non_camel_case_types)] #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)] pub enum Country { {%- for country in countries %} - #[cfg(feature = "{{country.code}}")] - /// {{country.name}} - {{country.code}}, + #[cfg(feature = "{{country.code}}")] + /// {{country|display_name}} + {{country|enum_name}}, {%- endfor %} } @@ -136,28 +212,48 @@ class Country: } impl AsRef for Country { - fn as_ref(&self) -> &str { - match self { + #[allow(clippy::too_many_lines)] + fn as_ref(&self) -> &str { + match self { {%- for country in countries %} - #[cfg(feature = "{{country.code}}")] - Country::{{country.code}} => "{{country.code}}", + #[cfg(feature = "{{country.code}}")] + Country::{{country|enum_name}} => "{{country|enum_name}}", {%- endfor %} + } } - } } impl std::str::FromStr for Country { - type Err = Error; + type Err = Error; + + #[allow(clippy::too_many_lines)] + fn from_str(s: &str) -> std::result::Result { + Ok(match s { +{%- for country in countries %} + #[cfg(feature = "{{country.code}}")] + "{{country|enum_name}}" => Country::{{country|enum_name}}, +{%- endfor %} + _ => return Err(Error::CountryNotAvailable), + }) + } +} - fn from_str(s: &str) -> std::result::Result { - Ok(match s { +impl Country { + #[must_use] + pub fn country_from_subdivision(subdivision: Country) -> Option { + Some(match subdivision { {%- for country in countries %} - #[cfg(feature = "{{country.code}}")] - "{{country.code}}" => Country::{{country.code}}, +{%- if country.subdivision_code == None and subdivisionsPerCountry[country.code] %} + #[cfg(feature = "{{country.code}}")] +{%- for subdiv in subdivisionsPerCountry[country.code] %} + | Country::{{subdiv|enum_name}} +{%- endfor %} + => Country::{{country|enum_name}}, +{%- endif %} {%- endfor %} - _ => return Err(Error::CountryNotAvailable), - }) - } + _ => return None, + }) + } } """ @@ -165,65 +261,91 @@ class Country: build = """ use std::collections::HashSet; -use crate::{data::*, prelude::*, HolidayMap, Result, Year}; +use crate::{ + data::{ + self, + helper::{add_main_country_from_subdivisions, should_build}, + }, + prelude::*, + HolidayMap, Result, Year, +}; /// Generate holiday map for the specified countries and years. -pub fn build(countries: Option<&HashSet>, years: Option<&std::ops::Range>) -> Result { - let mut map = HolidayMap::new(); +#[allow(clippy::too_many_lines)] +pub fn build(countries: Option>, years: Option<&std::ops::Range>) -> Result { + let countries = countries.map(|mut c| { + add_main_country_from_subdivisions(&mut c); + c + }); + + let countries = countries.as_ref(); + + let mut map = HolidayMap::new(); + {% for country in countries %} - #[cfg(feature = "{{country.code}}")] - if countries.is_none() || countries.unwrap().contains(&Country::{{country.code}}) { - map.insert(Country::{{country.code}}, {{country.code|escape}}::build(&years)?); - } + #[cfg(feature = "{{country.code}}")] + if should_build(countries, Country::{{country|enum_name}}) { + map.insert(Country::{{country|enum_name}}, data::{{country|mod_name|escape}}::build(years)?); + } {% endfor %} - Ok(map) + + Ok(map) } """ country_mod = """ -mod helper; +pub(super) mod helper; -use crate::{prelude::*, Holiday, NaiveDateExt, Result, Year}; +use crate::{prelude::*, HolidayPerYearMap, NaiveDateExt, Result, Year}; use helper::build_year; use chrono::NaiveDate; -use std::collections::BTreeMap; use std::collections::HashMap; {% for country in countries %} #[cfg(feature = "{{country.code}}")] -pub mod {{country.code|escape}}; +pub mod {{country|mod_name|escape}}; {% endfor %} """ build_country = """ -//! {{country}} +//! {{country|display_name}} +#[allow(clippy::wildcard_imports)] use super::*; -/// Generate holiday map for {{country}}. -#[allow(unused_mut, unused_variables)] -pub fn build(years: &Option<&std::ops::Range>) -> Result>> { - let mut map = HashMap::new(); +const COUNTY_NAME: &str = "{{country|display_name}}"; +const COUNTY_CODE: Country = Country::{{country|enum_name}}; + +/// Generate holiday map for {{country|display_name}}. +#[allow(unused_mut, unused_variables, clippy::too_many_lines, clippy::missing_errors_doc)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); +{% if country.subdivision_code %} + let mut national_holidays = de::build(years)?; +{%- endif %} {%- for year in years %} -{% if holiday(years=year) %} - build_year( - years, - {{year}}, - vec![ -{% for date, name in holiday(years=year).items() %} - (NaiveDate::from_ymd_res({{date|year}}, {{date|month}}, {{date|day}})?, "{{name}}"), +{% if holiday(years=year, subdiv=country.subdivision_code) %} + + build_year( + years, + {{year}}, + [ +{%- for date, name in holiday(years=year, subdiv=country.subdivision_code).items() %} +{%- if country.subdivision_code == None or date not in holiday(years=year) %} + (NaiveDate::from_ymd_res({{date|year}}, {{date|month}}, {{date|day}})?, "{{name}}"), +{%- endif %} {%- endfor %} - ], - &mut map, - Country::{{code}}, - "{{country}}", - ); + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); {%- endif %} {%- endfor %} - Ok(map) + Ok(map) } """ @@ -231,7 +353,6 @@ class Country: def lower(code: str) -> str: return code.lower() - def escape(code: str) -> str: rust_keywords = ["as", "in", "do"] lower = code.lower() @@ -240,10 +361,28 @@ def escape(code: str) -> str: else: return lower +def enum_name(country: Country) -> str: + if country.subdivision_code: + return f"{country.code}_{country.subdivision_code}" + else: + return country.code + +def mod_name(country: Country) -> str: + return enum_name(country).lower() + +def display_name(country: Country) -> str: + if country.subdivision_name: + return f"{country.name} ({country.subdivision_name})" + else: + return country.name -def empty_holiday(**kwargs): - return {} +def subdivisionsPerCountry(countries: list[Country]) -> dict[str, list[Country]]: + subdivisionsPerCountry = {} + for country in countries: + if country.subdivision_code == None: + subdivisionsPerCountry[country.code] = list(filter(lambda c: c.subdivision_code and c.code == country.code, countries)) + return subdivisionsPerCountry if __name__ == "__main__": env = Environment() @@ -251,9 +390,14 @@ def empty_holiday(**kwargs): env.filters["month"] = lambda d: d.month env.filters["day"] = lambda d: d.day env.filters["escape"] = escape - env.filters["lower"] = lower + env.filters["enum_name"] = enum_name + env.filters["mod_name"] = mod_name + env.filters["display_name"] = display_name + with open("src/country.rs", "w") as f: - rendered = env.from_string(country).render(countries=countries) + rendered = env.from_string(country).render( + countries=countries, + subdivisionsPerCountry=subdivisionsPerCountry(countries)) f.write(rendered) with open("src/build.rs", "w") as f: @@ -263,13 +407,12 @@ def empty_holiday(**kwargs): with open("src/data/mod.rs", "w") as f: rendered = env.from_string(country_mod).render(countries=countries) f.write(rendered) - + for country in countries: - with open("src/data/{}.rs".format(country.code.lower()), "w") as f: - holiday = getattr(holidays, country.code, None) + with open("src/data/{}.rs".format(mod_name(country)), "w") as f: + holiday = getattr(holidays, country.code, {}) rendered = env.from_string(build_country).render( - code=country.code, - country=country.name, + country=country, years=years, - holiday=holiday or empty_holiday) + holiday=holiday) f.write(rendered) diff --git a/src/build.rs b/src/build.rs index caa9ff3..bbff691 100644 --- a/src/build.rs +++ b/src/build.rs @@ -1,517 +1,902 @@ use std::collections::HashSet; -use crate::{data::*, prelude::*, HolidayMap, Result, Year}; +use crate::{ + data::{ + self, + helper::{add_main_country_from_subdivisions, should_build}, + }, + prelude::*, + HolidayMap, Result, Year, +}; /// Generate holiday map for the specified countries and years. +#[allow(clippy::too_many_lines)] pub fn build( - countries: Option<&HashSet>, + countries: Option>, years: Option<&std::ops::Range>, ) -> Result { + let countries = countries.map(|mut c| { + add_main_country_from_subdivisions(&mut c); + c + }); + + let countries = countries.as_ref(); + let mut map = HolidayMap::new(); #[cfg(feature = "AO")] - if countries.is_none() || countries.unwrap().contains(&Country::AO) { - map.insert(Country::AO, ao::build(&years)?); + if should_build(countries, Country::AO) { + map.insert(Country::AO, data::ao::build(years)?); } #[cfg(feature = "AR")] - if countries.is_none() || countries.unwrap().contains(&Country::AR) { - map.insert(Country::AR, ar::build(&years)?); + if should_build(countries, Country::AR) { + map.insert(Country::AR, data::ar::build(years)?); } #[cfg(feature = "AM")] - if countries.is_none() || countries.unwrap().contains(&Country::AM) { - map.insert(Country::AM, am::build(&years)?); + if should_build(countries, Country::AM) { + map.insert(Country::AM, data::am::build(years)?); } #[cfg(feature = "AW")] - if countries.is_none() || countries.unwrap().contains(&Country::AW) { - map.insert(Country::AW, aw::build(&years)?); + if should_build(countries, Country::AW) { + map.insert(Country::AW, data::aw::build(years)?); } #[cfg(feature = "AU")] - if countries.is_none() || countries.unwrap().contains(&Country::AU) { - map.insert(Country::AU, au::build(&years)?); + if should_build(countries, Country::AU) { + map.insert(Country::AU, data::au::build(years)?); } #[cfg(feature = "AT")] - if countries.is_none() || countries.unwrap().contains(&Country::AT) { - map.insert(Country::AT, at::build(&years)?); + if should_build(countries, Country::AT) { + map.insert(Country::AT, data::at::build(years)?); } #[cfg(feature = "AZ")] - if countries.is_none() || countries.unwrap().contains(&Country::AZ) { - map.insert(Country::AZ, az::build(&years)?); + if should_build(countries, Country::AZ) { + map.insert(Country::AZ, data::az::build(years)?); } #[cfg(feature = "BD")] - if countries.is_none() || countries.unwrap().contains(&Country::BD) { - map.insert(Country::BD, bd::build(&years)?); + if should_build(countries, Country::BD) { + map.insert(Country::BD, data::bd::build(years)?); } #[cfg(feature = "BY")] - if countries.is_none() || countries.unwrap().contains(&Country::BY) { - map.insert(Country::BY, by::build(&years)?); + if should_build(countries, Country::BY) { + map.insert(Country::BY, data::by::build(years)?); } #[cfg(feature = "BE")] - if countries.is_none() || countries.unwrap().contains(&Country::BE) { - map.insert(Country::BE, be::build(&years)?); + if should_build(countries, Country::BE) { + map.insert(Country::BE, data::be::build(years)?); } #[cfg(feature = "BO")] - if countries.is_none() || countries.unwrap().contains(&Country::BO) { - map.insert(Country::BO, bo::build(&years)?); + if should_build(countries, Country::BO) { + map.insert(Country::BO, data::bo::build(years)?); } #[cfg(feature = "BA")] - if countries.is_none() || countries.unwrap().contains(&Country::BA) { - map.insert(Country::BA, ba::build(&years)?); + if should_build(countries, Country::BA) { + map.insert(Country::BA, data::ba::build(years)?); } #[cfg(feature = "BW")] - if countries.is_none() || countries.unwrap().contains(&Country::BW) { - map.insert(Country::BW, bw::build(&years)?); + if should_build(countries, Country::BW) { + map.insert(Country::BW, data::bw::build(years)?); } #[cfg(feature = "BR")] - if countries.is_none() || countries.unwrap().contains(&Country::BR) { - map.insert(Country::BR, br::build(&years)?); + if should_build(countries, Country::BR) { + map.insert(Country::BR, data::br::build(years)?); } #[cfg(feature = "BG")] - if countries.is_none() || countries.unwrap().contains(&Country::BG) { - map.insert(Country::BG, bg::build(&years)?); + if should_build(countries, Country::BG) { + map.insert(Country::BG, data::bg::build(years)?); } #[cfg(feature = "BI")] - if countries.is_none() || countries.unwrap().contains(&Country::BI) { - map.insert(Country::BI, bi::build(&years)?); + if should_build(countries, Country::BI) { + map.insert(Country::BI, data::bi::build(years)?); } #[cfg(feature = "CA")] - if countries.is_none() || countries.unwrap().contains(&Country::CA) { - map.insert(Country::CA, ca::build(&years)?); + if should_build(countries, Country::CA) { + map.insert(Country::CA, data::ca::build(years)?); } #[cfg(feature = "CL")] - if countries.is_none() || countries.unwrap().contains(&Country::CL) { - map.insert(Country::CL, cl::build(&years)?); + if should_build(countries, Country::CL) { + map.insert(Country::CL, data::cl::build(years)?); } #[cfg(feature = "CN")] - if countries.is_none() || countries.unwrap().contains(&Country::CN) { - map.insert(Country::CN, cn::build(&years)?); + if should_build(countries, Country::CN) { + map.insert(Country::CN, data::cn::build(years)?); } #[cfg(feature = "CO")] - if countries.is_none() || countries.unwrap().contains(&Country::CO) { - map.insert(Country::CO, co::build(&years)?); + if should_build(countries, Country::CO) { + map.insert(Country::CO, data::co::build(years)?); } #[cfg(feature = "HR")] - if countries.is_none() || countries.unwrap().contains(&Country::HR) { - map.insert(Country::HR, hr::build(&years)?); + if should_build(countries, Country::HR) { + map.insert(Country::HR, data::hr::build(years)?); } #[cfg(feature = "CU")] - if countries.is_none() || countries.unwrap().contains(&Country::CU) { - map.insert(Country::CU, cu::build(&years)?); + if should_build(countries, Country::CU) { + map.insert(Country::CU, data::cu::build(years)?); } #[cfg(feature = "CW")] - if countries.is_none() || countries.unwrap().contains(&Country::CW) { - map.insert(Country::CW, cw::build(&years)?); + if should_build(countries, Country::CW) { + map.insert(Country::CW, data::cw::build(years)?); } #[cfg(feature = "CY")] - if countries.is_none() || countries.unwrap().contains(&Country::CY) { - map.insert(Country::CY, cy::build(&years)?); + if should_build(countries, Country::CY) { + map.insert(Country::CY, data::cy::build(years)?); } #[cfg(feature = "CZ")] - if countries.is_none() || countries.unwrap().contains(&Country::CZ) { - map.insert(Country::CZ, cz::build(&years)?); + if should_build(countries, Country::CZ) { + map.insert(Country::CZ, data::cz::build(years)?); } #[cfg(feature = "DK")] - if countries.is_none() || countries.unwrap().contains(&Country::DK) { - map.insert(Country::DK, dk::build(&years)?); + if should_build(countries, Country::DK) { + map.insert(Country::DK, data::dk::build(years)?); } #[cfg(feature = "DJ")] - if countries.is_none() || countries.unwrap().contains(&Country::DJ) { - map.insert(Country::DJ, dj::build(&years)?); + if should_build(countries, Country::DJ) { + map.insert(Country::DJ, data::dj::build(years)?); } #[cfg(feature = "DO")] - if countries.is_none() || countries.unwrap().contains(&Country::DO) { - map.insert(Country::DO, r#do::build(&years)?); + if should_build(countries, Country::DO) { + map.insert(Country::DO, data::r#do::build(years)?); } #[cfg(feature = "EG")] - if countries.is_none() || countries.unwrap().contains(&Country::EG) { - map.insert(Country::EG, eg::build(&years)?); + if should_build(countries, Country::EG) { + map.insert(Country::EG, data::eg::build(years)?); } #[cfg(feature = "EE")] - if countries.is_none() || countries.unwrap().contains(&Country::EE) { - map.insert(Country::EE, ee::build(&years)?); + if should_build(countries, Country::EE) { + map.insert(Country::EE, data::ee::build(years)?); } #[cfg(feature = "ET")] - if countries.is_none() || countries.unwrap().contains(&Country::ET) { - map.insert(Country::ET, et::build(&years)?); + if should_build(countries, Country::ET) { + map.insert(Country::ET, data::et::build(years)?); } #[cfg(feature = "FI")] - if countries.is_none() || countries.unwrap().contains(&Country::FI) { - map.insert(Country::FI, fi::build(&years)?); + if should_build(countries, Country::FI) { + map.insert(Country::FI, data::fi::build(years)?); } #[cfg(feature = "FR")] - if countries.is_none() || countries.unwrap().contains(&Country::FR) { - map.insert(Country::FR, fr::build(&years)?); + if should_build(countries, Country::FR) { + map.insert(Country::FR, data::fr::build(years)?); } #[cfg(feature = "GE")] - if countries.is_none() || countries.unwrap().contains(&Country::GE) { - map.insert(Country::GE, ge::build(&years)?); + if should_build(countries, Country::GE) { + map.insert(Country::GE, data::ge::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE) { + map.insert(Country::DE, data::de::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_BB) { + map.insert(Country::DE_BB, data::de_bb::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_BE) { + map.insert(Country::DE_BE, data::de_be::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_BW) { + map.insert(Country::DE_BW, data::de_bw::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_BY) { + map.insert(Country::DE_BY, data::de_by::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_BYP) { + map.insert(Country::DE_BYP, data::de_byp::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_HB) { + map.insert(Country::DE_HB, data::de_hb::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_HE) { + map.insert(Country::DE_HE, data::de_he::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_HH) { + map.insert(Country::DE_HH, data::de_hh::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_MV) { + map.insert(Country::DE_MV, data::de_mv::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_NI) { + map.insert(Country::DE_NI, data::de_ni::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_NW) { + map.insert(Country::DE_NW, data::de_nw::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_RP) { + map.insert(Country::DE_RP, data::de_rp::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_SH) { + map.insert(Country::DE_SH, data::de_sh::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_SL) { + map.insert(Country::DE_SL, data::de_sl::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_SN) { + map.insert(Country::DE_SN, data::de_sn::build(years)?); + } + + #[cfg(feature = "DE")] + if should_build(countries, Country::DE_ST) { + map.insert(Country::DE_ST, data::de_st::build(years)?); } #[cfg(feature = "DE")] - if countries.is_none() || countries.unwrap().contains(&Country::DE) { - map.insert(Country::DE, de::build(&years)?); + if should_build(countries, Country::DE_TH) { + map.insert(Country::DE_TH, data::de_th::build(years)?); } #[cfg(feature = "GR")] - if countries.is_none() || countries.unwrap().contains(&Country::GR) { - map.insert(Country::GR, gr::build(&years)?); + if should_build(countries, Country::GR) { + map.insert(Country::GR, data::gr::build(years)?); } #[cfg(feature = "HN")] - if countries.is_none() || countries.unwrap().contains(&Country::HN) { - map.insert(Country::HN, hn::build(&years)?); + if should_build(countries, Country::HN) { + map.insert(Country::HN, data::hn::build(years)?); } #[cfg(feature = "HK")] - if countries.is_none() || countries.unwrap().contains(&Country::HK) { - map.insert(Country::HK, hk::build(&years)?); + if should_build(countries, Country::HK) { + map.insert(Country::HK, data::hk::build(years)?); } #[cfg(feature = "HU")] - if countries.is_none() || countries.unwrap().contains(&Country::HU) { - map.insert(Country::HU, hu::build(&years)?); + if should_build(countries, Country::HU) { + map.insert(Country::HU, data::hu::build(years)?); } #[cfg(feature = "IS")] - if countries.is_none() || countries.unwrap().contains(&Country::IS) { - map.insert(Country::IS, is::build(&years)?); + if should_build(countries, Country::IS) { + map.insert(Country::IS, data::is::build(years)?); } #[cfg(feature = "IN")] - if countries.is_none() || countries.unwrap().contains(&Country::IN) { - map.insert(Country::IN, r#in::build(&years)?); + if should_build(countries, Country::IN) { + map.insert(Country::IN, data::r#in::build(years)?); } #[cfg(feature = "ID")] - if countries.is_none() || countries.unwrap().contains(&Country::ID) { - map.insert(Country::ID, id::build(&years)?); + if should_build(countries, Country::ID) { + map.insert(Country::ID, data::id::build(years)?); } #[cfg(feature = "IE")] - if countries.is_none() || countries.unwrap().contains(&Country::IE) { - map.insert(Country::IE, ie::build(&years)?); + if should_build(countries, Country::IE) { + map.insert(Country::IE, data::ie::build(years)?); } #[cfg(feature = "IM")] - if countries.is_none() || countries.unwrap().contains(&Country::IM) { - map.insert(Country::IM, im::build(&years)?); + if should_build(countries, Country::IM) { + map.insert(Country::IM, data::im::build(years)?); } #[cfg(feature = "IL")] - if countries.is_none() || countries.unwrap().contains(&Country::IL) { - map.insert(Country::IL, il::build(&years)?); + if should_build(countries, Country::IL) { + map.insert(Country::IL, data::il::build(years)?); } #[cfg(feature = "IT")] - if countries.is_none() || countries.unwrap().contains(&Country::IT) { - map.insert(Country::IT, it::build(&years)?); + if should_build(countries, Country::IT) { + map.insert(Country::IT, data::it::build(years)?); } #[cfg(feature = "JM")] - if countries.is_none() || countries.unwrap().contains(&Country::JM) { - map.insert(Country::JM, jm::build(&years)?); + if should_build(countries, Country::JM) { + map.insert(Country::JM, data::jm::build(years)?); } #[cfg(feature = "JP")] - if countries.is_none() || countries.unwrap().contains(&Country::JP) { - map.insert(Country::JP, jp::build(&years)?); + if should_build(countries, Country::JP) { + map.insert(Country::JP, data::jp::build(years)?); } #[cfg(feature = "KZ")] - if countries.is_none() || countries.unwrap().contains(&Country::KZ) { - map.insert(Country::KZ, kz::build(&years)?); + if should_build(countries, Country::KZ) { + map.insert(Country::KZ, data::kz::build(years)?); } #[cfg(feature = "KE")] - if countries.is_none() || countries.unwrap().contains(&Country::KE) { - map.insert(Country::KE, ke::build(&years)?); + if should_build(countries, Country::KE) { + map.insert(Country::KE, data::ke::build(years)?); } #[cfg(feature = "LV")] - if countries.is_none() || countries.unwrap().contains(&Country::LV) { - map.insert(Country::LV, lv::build(&years)?); + if should_build(countries, Country::LV) { + map.insert(Country::LV, data::lv::build(years)?); } #[cfg(feature = "LS")] - if countries.is_none() || countries.unwrap().contains(&Country::LS) { - map.insert(Country::LS, ls::build(&years)?); + if should_build(countries, Country::LS) { + map.insert(Country::LS, data::ls::build(years)?); } #[cfg(feature = "LI")] - if countries.is_none() || countries.unwrap().contains(&Country::LI) { - map.insert(Country::LI, li::build(&years)?); + if should_build(countries, Country::LI) { + map.insert(Country::LI, data::li::build(years)?); } #[cfg(feature = "LT")] - if countries.is_none() || countries.unwrap().contains(&Country::LT) { - map.insert(Country::LT, lt::build(&years)?); + if should_build(countries, Country::LT) { + map.insert(Country::LT, data::lt::build(years)?); } #[cfg(feature = "LU")] - if countries.is_none() || countries.unwrap().contains(&Country::LU) { - map.insert(Country::LU, lu::build(&years)?); + if should_build(countries, Country::LU) { + map.insert(Country::LU, data::lu::build(years)?); } #[cfg(feature = "MG")] - if countries.is_none() || countries.unwrap().contains(&Country::MG) { - map.insert(Country::MG, mg::build(&years)?); + if should_build(countries, Country::MG) { + map.insert(Country::MG, data::mg::build(years)?); } #[cfg(feature = "MY")] - if countries.is_none() || countries.unwrap().contains(&Country::MY) { - map.insert(Country::MY, my::build(&years)?); + if should_build(countries, Country::MY) { + map.insert(Country::MY, data::my::build(years)?); } #[cfg(feature = "MW")] - if countries.is_none() || countries.unwrap().contains(&Country::MW) { - map.insert(Country::MW, mw::build(&years)?); + if should_build(countries, Country::MW) { + map.insert(Country::MW, data::mw::build(years)?); } #[cfg(feature = "MT")] - if countries.is_none() || countries.unwrap().contains(&Country::MT) { - map.insert(Country::MT, mt::build(&years)?); + if should_build(countries, Country::MT) { + map.insert(Country::MT, data::mt::build(years)?); } #[cfg(feature = "MX")] - if countries.is_none() || countries.unwrap().contains(&Country::MX) { - map.insert(Country::MX, mx::build(&years)?); + if should_build(countries, Country::MX) { + map.insert(Country::MX, data::mx::build(years)?); } #[cfg(feature = "MD")] - if countries.is_none() || countries.unwrap().contains(&Country::MD) { - map.insert(Country::MD, md::build(&years)?); + if should_build(countries, Country::MD) { + map.insert(Country::MD, data::md::build(years)?); } #[cfg(feature = "MA")] - if countries.is_none() || countries.unwrap().contains(&Country::MA) { - map.insert(Country::MA, ma::build(&years)?); + if should_build(countries, Country::MA) { + map.insert(Country::MA, data::ma::build(years)?); } #[cfg(feature = "MZ")] - if countries.is_none() || countries.unwrap().contains(&Country::MZ) { - map.insert(Country::MZ, mz::build(&years)?); + if should_build(countries, Country::MZ) { + map.insert(Country::MZ, data::mz::build(years)?); } #[cfg(feature = "NL")] - if countries.is_none() || countries.unwrap().contains(&Country::NL) { - map.insert(Country::NL, nl::build(&years)?); + if should_build(countries, Country::NL) { + map.insert(Country::NL, data::nl::build(years)?); } #[cfg(feature = "NA")] - if countries.is_none() || countries.unwrap().contains(&Country::NA) { - map.insert(Country::NA, na::build(&years)?); + if should_build(countries, Country::NA) { + map.insert(Country::NA, data::na::build(years)?); } #[cfg(feature = "NZ")] - if countries.is_none() || countries.unwrap().contains(&Country::NZ) { - map.insert(Country::NZ, nz::build(&years)?); + if should_build(countries, Country::NZ) { + map.insert(Country::NZ, data::nz::build(years)?); } #[cfg(feature = "NI")] - if countries.is_none() || countries.unwrap().contains(&Country::NI) { - map.insert(Country::NI, ni::build(&years)?); + if should_build(countries, Country::NI) { + map.insert(Country::NI, data::ni::build(years)?); } #[cfg(feature = "NG")] - if countries.is_none() || countries.unwrap().contains(&Country::NG) { - map.insert(Country::NG, ng::build(&years)?); + if should_build(countries, Country::NG) { + map.insert(Country::NG, data::ng::build(years)?); } #[cfg(feature = "MK")] - if countries.is_none() || countries.unwrap().contains(&Country::MK) { - map.insert(Country::MK, mk::build(&years)?); + if should_build(countries, Country::MK) { + map.insert(Country::MK, data::mk::build(years)?); } #[cfg(feature = "NO")] - if countries.is_none() || countries.unwrap().contains(&Country::NO) { - map.insert(Country::NO, no::build(&years)?); + if should_build(countries, Country::NO) { + map.insert(Country::NO, data::no::build(years)?); } #[cfg(feature = "PK")] - if countries.is_none() || countries.unwrap().contains(&Country::PK) { - map.insert(Country::PK, pk::build(&years)?); + if should_build(countries, Country::PK) { + map.insert(Country::PK, data::pk::build(years)?); } #[cfg(feature = "PY")] - if countries.is_none() || countries.unwrap().contains(&Country::PY) { - map.insert(Country::PY, py::build(&years)?); + if should_build(countries, Country::PY) { + map.insert(Country::PY, data::py::build(years)?); } #[cfg(feature = "PE")] - if countries.is_none() || countries.unwrap().contains(&Country::PE) { - map.insert(Country::PE, pe::build(&years)?); + if should_build(countries, Country::PE) { + map.insert(Country::PE, data::pe::build(years)?); } #[cfg(feature = "PL")] - if countries.is_none() || countries.unwrap().contains(&Country::PL) { - map.insert(Country::PL, pl::build(&years)?); + if should_build(countries, Country::PL) { + map.insert(Country::PL, data::pl::build(years)?); } #[cfg(feature = "PT")] - if countries.is_none() || countries.unwrap().contains(&Country::PT) { - map.insert(Country::PT, pt::build(&years)?); + if should_build(countries, Country::PT) { + map.insert(Country::PT, data::pt::build(years)?); } #[cfg(feature = "RO")] - if countries.is_none() || countries.unwrap().contains(&Country::RO) { - map.insert(Country::RO, ro::build(&years)?); + if should_build(countries, Country::RO) { + map.insert(Country::RO, data::ro::build(years)?); } #[cfg(feature = "RU")] - if countries.is_none() || countries.unwrap().contains(&Country::RU) { - map.insert(Country::RU, ru::build(&years)?); + if should_build(countries, Country::RU) { + map.insert(Country::RU, data::ru::build(years)?); } #[cfg(feature = "SA")] - if countries.is_none() || countries.unwrap().contains(&Country::SA) { - map.insert(Country::SA, sa::build(&years)?); + if should_build(countries, Country::SA) { + map.insert(Country::SA, data::sa::build(years)?); } #[cfg(feature = "RS")] - if countries.is_none() || countries.unwrap().contains(&Country::RS) { - map.insert(Country::RS, rs::build(&years)?); + if should_build(countries, Country::RS) { + map.insert(Country::RS, data::rs::build(years)?); } #[cfg(feature = "SG")] - if countries.is_none() || countries.unwrap().contains(&Country::SG) { - map.insert(Country::SG, sg::build(&years)?); + if should_build(countries, Country::SG) { + map.insert(Country::SG, data::sg::build(years)?); } #[cfg(feature = "SK")] - if countries.is_none() || countries.unwrap().contains(&Country::SK) { - map.insert(Country::SK, sk::build(&years)?); + if should_build(countries, Country::SK) { + map.insert(Country::SK, data::sk::build(years)?); } #[cfg(feature = "SI")] - if countries.is_none() || countries.unwrap().contains(&Country::SI) { - map.insert(Country::SI, si::build(&years)?); + if should_build(countries, Country::SI) { + map.insert(Country::SI, data::si::build(years)?); } #[cfg(feature = "ZA")] - if countries.is_none() || countries.unwrap().contains(&Country::ZA) { - map.insert(Country::ZA, za::build(&years)?); + if should_build(countries, Country::ZA) { + map.insert(Country::ZA, data::za::build(years)?); } #[cfg(feature = "KR")] - if countries.is_none() || countries.unwrap().contains(&Country::KR) { - map.insert(Country::KR, kr::build(&years)?); + if should_build(countries, Country::KR) { + map.insert(Country::KR, data::kr::build(years)?); } #[cfg(feature = "ES")] - if countries.is_none() || countries.unwrap().contains(&Country::ES) { - map.insert(Country::ES, es::build(&years)?); + if should_build(countries, Country::ES) { + map.insert(Country::ES, data::es::build(years)?); } #[cfg(feature = "SZ")] - if countries.is_none() || countries.unwrap().contains(&Country::SZ) { - map.insert(Country::SZ, sz::build(&years)?); + if should_build(countries, Country::SZ) { + map.insert(Country::SZ, data::sz::build(years)?); } #[cfg(feature = "SE")] - if countries.is_none() || countries.unwrap().contains(&Country::SE) { - map.insert(Country::SE, se::build(&years)?); + if should_build(countries, Country::SE) { + map.insert(Country::SE, data::se::build(years)?); } #[cfg(feature = "CH")] - if countries.is_none() || countries.unwrap().contains(&Country::CH) { - map.insert(Country::CH, ch::build(&years)?); + if should_build(countries, Country::CH) { + map.insert(Country::CH, data::ch::build(years)?); } #[cfg(feature = "TW")] - if countries.is_none() || countries.unwrap().contains(&Country::TW) { - map.insert(Country::TW, tw::build(&years)?); + if should_build(countries, Country::TW) { + map.insert(Country::TW, data::tw::build(years)?); } #[cfg(feature = "TR")] - if countries.is_none() || countries.unwrap().contains(&Country::TR) { - map.insert(Country::TR, tr::build(&years)?); + if should_build(countries, Country::TR) { + map.insert(Country::TR, data::tr::build(years)?); } #[cfg(feature = "TN")] - if countries.is_none() || countries.unwrap().contains(&Country::TN) { - map.insert(Country::TN, tn::build(&years)?); + if should_build(countries, Country::TN) { + map.insert(Country::TN, data::tn::build(years)?); } #[cfg(feature = "UA")] - if countries.is_none() || countries.unwrap().contains(&Country::UA) { - map.insert(Country::UA, ua::build(&years)?); + if should_build(countries, Country::UA) { + map.insert(Country::UA, data::ua::build(years)?); } #[cfg(feature = "AE")] - if countries.is_none() || countries.unwrap().contains(&Country::AE) { - map.insert(Country::AE, ae::build(&years)?); + if should_build(countries, Country::AE) { + map.insert(Country::AE, data::ae::build(years)?); } #[cfg(feature = "GB")] - if countries.is_none() || countries.unwrap().contains(&Country::GB) { - map.insert(Country::GB, gb::build(&years)?); + if should_build(countries, Country::GB) { + map.insert(Country::GB, data::gb::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US) { + map.insert(Country::US, data::us::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_AK) { + map.insert(Country::US_AK, data::us_ak::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_AL) { + map.insert(Country::US_AL, data::us_al::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_AR) { + map.insert(Country::US_AR, data::us_ar::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_AS) { + map.insert(Country::US_AS, data::us_as::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_AZ) { + map.insert(Country::US_AZ, data::us_az::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_CA) { + map.insert(Country::US_CA, data::us_ca::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_CO) { + map.insert(Country::US_CO, data::us_co::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_CT) { + map.insert(Country::US_CT, data::us_ct::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_DC) { + map.insert(Country::US_DC, data::us_dc::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_DE) { + map.insert(Country::US_DE, data::us_de::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_FL) { + map.insert(Country::US_FL, data::us_fl::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_GA) { + map.insert(Country::US_GA, data::us_ga::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_GU) { + map.insert(Country::US_GU, data::us_gu::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_HI) { + map.insert(Country::US_HI, data::us_hi::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_IA) { + map.insert(Country::US_IA, data::us_ia::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_ID) { + map.insert(Country::US_ID, data::us_id::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_IL) { + map.insert(Country::US_IL, data::us_il::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_IN) { + map.insert(Country::US_IN, data::us_in::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_KS) { + map.insert(Country::US_KS, data::us_ks::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_KY) { + map.insert(Country::US_KY, data::us_ky::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_LA) { + map.insert(Country::US_LA, data::us_la::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MA) { + map.insert(Country::US_MA, data::us_ma::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MD) { + map.insert(Country::US_MD, data::us_md::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_ME) { + map.insert(Country::US_ME, data::us_me::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MI) { + map.insert(Country::US_MI, data::us_mi::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MN) { + map.insert(Country::US_MN, data::us_mn::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MO) { + map.insert(Country::US_MO, data::us_mo::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MP) { + map.insert(Country::US_MP, data::us_mp::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MS) { + map.insert(Country::US_MS, data::us_ms::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_MT) { + map.insert(Country::US_MT, data::us_mt::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_NC) { + map.insert(Country::US_NC, data::us_nc::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_ND) { + map.insert(Country::US_ND, data::us_nd::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_NE) { + map.insert(Country::US_NE, data::us_ne::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_NH) { + map.insert(Country::US_NH, data::us_nh::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_NJ) { + map.insert(Country::US_NJ, data::us_nj::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_NM) { + map.insert(Country::US_NM, data::us_nm::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_NV) { + map.insert(Country::US_NV, data::us_nv::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_NY) { + map.insert(Country::US_NY, data::us_ny::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_OH) { + map.insert(Country::US_OH, data::us_oh::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_OK) { + map.insert(Country::US_OK, data::us_ok::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_OR) { + map.insert(Country::US_OR, data::us_or::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_PA) { + map.insert(Country::US_PA, data::us_pa::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_PR) { + map.insert(Country::US_PR, data::us_pr::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_RI) { + map.insert(Country::US_RI, data::us_ri::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_SC) { + map.insert(Country::US_SC, data::us_sc::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_SD) { + map.insert(Country::US_SD, data::us_sd::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_TN) { + map.insert(Country::US_TN, data::us_tn::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_TX) { + map.insert(Country::US_TX, data::us_tx::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_UM) { + map.insert(Country::US_UM, data::us_um::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_UT) { + map.insert(Country::US_UT, data::us_ut::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_VA) { + map.insert(Country::US_VA, data::us_va::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_VI) { + map.insert(Country::US_VI, data::us_vi::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_VT) { + map.insert(Country::US_VT, data::us_vt::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_WA) { + map.insert(Country::US_WA, data::us_wa::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_WI) { + map.insert(Country::US_WI, data::us_wi::build(years)?); + } + + #[cfg(feature = "US")] + if should_build(countries, Country::US_WV) { + map.insert(Country::US_WV, data::us_wv::build(years)?); } #[cfg(feature = "US")] - if countries.is_none() || countries.unwrap().contains(&Country::US) { - map.insert(Country::US, us::build(&years)?); + if should_build(countries, Country::US_WY) { + map.insert(Country::US_WY, data::us_wy::build(years)?); } #[cfg(feature = "UY")] - if countries.is_none() || countries.unwrap().contains(&Country::UY) { - map.insert(Country::UY, uy::build(&years)?); + if should_build(countries, Country::UY) { + map.insert(Country::UY, data::uy::build(years)?); } #[cfg(feature = "UZ")] - if countries.is_none() || countries.unwrap().contains(&Country::UZ) { - map.insert(Country::UZ, uz::build(&years)?); + if should_build(countries, Country::UZ) { + map.insert(Country::UZ, data::uz::build(years)?); } #[cfg(feature = "VE")] - if countries.is_none() || countries.unwrap().contains(&Country::VE) { - map.insert(Country::VE, ve::build(&years)?); + if should_build(countries, Country::VE) { + map.insert(Country::VE, data::ve::build(years)?); } #[cfg(feature = "VN")] - if countries.is_none() || countries.unwrap().contains(&Country::VN) { - map.insert(Country::VN, vn::build(&years)?); + if should_build(countries, Country::VN) { + map.insert(Country::VN, data::vn::build(years)?); } #[cfg(feature = "ZM")] - if countries.is_none() || countries.unwrap().contains(&Country::ZM) { - map.insert(Country::ZM, zm::build(&years)?); + if should_build(countries, Country::ZM) { + map.insert(Country::ZM, data::zm::build(years)?); } #[cfg(feature = "ZW")] - if countries.is_none() || countries.unwrap().contains(&Country::ZW) { - map.insert(Country::ZW, zw::build(&years)?); + if should_build(countries, Country::ZW) { + map.insert(Country::ZW, data::zw::build(years)?); } Ok(map) diff --git a/src/builder.rs b/src/builder.rs index 50ac7a1..9c0b8da 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -3,6 +3,7 @@ use std::{collections::HashSet, ops::Range}; /// Holiday database builder. #[derive(Default)] +#[must_use] pub struct Builder { countries: Option>, years: Option>, @@ -15,26 +16,27 @@ impl Builder { /// Specify ISO 3166-1 alpha-2 country codes to load. pub fn countries(mut self, countries: &[Country]) -> Self { - self.countries = Some(countries.iter().copied().collect()); + self.countries.replace(countries.iter().copied().collect()); self } /// Specify range of years to load. pub fn years(mut self, years: Range) -> Self { - self.years = Some(years); + self.years.replace(years); self } /// Build and get holiday database. + #[allow(clippy::missing_errors_doc)] pub fn build(self) -> Result { let Builder { countries, years } = self; - build(countries.as_ref(), years.as_ref()) + build(countries, years.as_ref()) } /// Build and initialize holiday database. + #[allow(clippy::missing_errors_doc)] pub fn init(self) -> Result<()> { - let Builder { countries, years } = self; - let map = build(countries.as_ref(), years.as_ref())?; + let map = self.build()?; init_holiday(map) } } diff --git a/src/country.rs b/src/country.rs index c5b9d63..f865a8e 100644 --- a/src/country.rs +++ b/src/country.rs @@ -2,6 +2,7 @@ use crate::Error; /// Two-letter country codes defined in ISO 3166-1 alpha-2 . #[allow(dead_code)] +#[allow(non_camel_case_types)] #[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)] pub enum Country { #[cfg(feature = "AO")] @@ -109,6 +110,57 @@ pub enum Country { #[cfg(feature = "DE")] /// Germany DE, + #[cfg(feature = "DE")] + /// Germany (Brandenburg) + DE_BB, + #[cfg(feature = "DE")] + /// Germany (Berlin) + DE_BE, + #[cfg(feature = "DE")] + /// Germany (Baden-Württemberg) + DE_BW, + #[cfg(feature = "DE")] + /// Germany (Bavaria (Bayern)) + DE_BY, + #[cfg(feature = "DE")] + /// Germany (Bavaria (Bayern) with more protestants) + DE_BYP, + #[cfg(feature = "DE")] + /// Germany (Bremen) + DE_HB, + #[cfg(feature = "DE")] + /// Germany (Hesse (Hessen)) + DE_HE, + #[cfg(feature = "DE")] + /// Germany (Hamburg) + DE_HH, + #[cfg(feature = "DE")] + /// Germany (Mecklenburg-Vorpommern) + DE_MV, + #[cfg(feature = "DE")] + /// Germany (Lower Saxony (Niedersachsen)) + DE_NI, + #[cfg(feature = "DE")] + /// Germany (North Rhine-Westphalia (Nordrhein-Westfalen)) + DE_NW, + #[cfg(feature = "DE")] + /// Germany (Rhineland-Palatinate (Rheinland-Pfalz)) + DE_RP, + #[cfg(feature = "DE")] + /// Germany (Schleswig-Holstein) + DE_SH, + #[cfg(feature = "DE")] + /// Germany (Saarland) + DE_SL, + #[cfg(feature = "DE")] + /// Germany (Saxony (Sachsen)) + DE_SN, + #[cfg(feature = "DE")] + /// Germany (Saxony-Anhalt (Sachsen-Anhalt)) + DE_ST, + #[cfg(feature = "DE")] + /// Germany (Thuringia (Thüringen)) + DE_TH, #[cfg(feature = "GR")] /// Greece GR, @@ -289,6 +341,177 @@ pub enum Country { #[cfg(feature = "US")] /// United States US, + #[cfg(feature = "US")] + /// United States (Alaska) + US_AK, + #[cfg(feature = "US")] + /// United States (Alabama) + US_AL, + #[cfg(feature = "US")] + /// United States (Arkansas) + US_AR, + #[cfg(feature = "US")] + /// United States (American Samoa) + US_AS, + #[cfg(feature = "US")] + /// United States (Arizona) + US_AZ, + #[cfg(feature = "US")] + /// United States (California) + US_CA, + #[cfg(feature = "US")] + /// United States (Colorado) + US_CO, + #[cfg(feature = "US")] + /// United States (Connecticut) + US_CT, + #[cfg(feature = "US")] + /// United States (District of Columbia) + US_DC, + #[cfg(feature = "US")] + /// United States (Delaware) + US_DE, + #[cfg(feature = "US")] + /// United States (Florida) + US_FL, + #[cfg(feature = "US")] + /// United States (Georgia) + US_GA, + #[cfg(feature = "US")] + /// United States (Guam) + US_GU, + #[cfg(feature = "US")] + /// United States (Hawaii) + US_HI, + #[cfg(feature = "US")] + /// United States (Iowa) + US_IA, + #[cfg(feature = "US")] + /// United States (Idaho) + US_ID, + #[cfg(feature = "US")] + /// United States (Illinois) + US_IL, + #[cfg(feature = "US")] + /// United States (Indiana) + US_IN, + #[cfg(feature = "US")] + /// United States (Kansas) + US_KS, + #[cfg(feature = "US")] + /// United States (Kentucky) + US_KY, + #[cfg(feature = "US")] + /// United States (Louisiana) + US_LA, + #[cfg(feature = "US")] + /// United States (Massachusetts) + US_MA, + #[cfg(feature = "US")] + /// United States (Maryland) + US_MD, + #[cfg(feature = "US")] + /// United States (Maine) + US_ME, + #[cfg(feature = "US")] + /// United States (Michigan) + US_MI, + #[cfg(feature = "US")] + /// United States (Minnesota) + US_MN, + #[cfg(feature = "US")] + /// United States (Missouri) + US_MO, + #[cfg(feature = "US")] + /// United States (Northern Mariana Islands) + US_MP, + #[cfg(feature = "US")] + /// United States (Mississippi) + US_MS, + #[cfg(feature = "US")] + /// United States (Montana) + US_MT, + #[cfg(feature = "US")] + /// United States (North Carolina) + US_NC, + #[cfg(feature = "US")] + /// United States (North Dakota) + US_ND, + #[cfg(feature = "US")] + /// United States (Nebraska) + US_NE, + #[cfg(feature = "US")] + /// United States (New Hampshire) + US_NH, + #[cfg(feature = "US")] + /// United States (New Jersey) + US_NJ, + #[cfg(feature = "US")] + /// United States (New Mexico) + US_NM, + #[cfg(feature = "US")] + /// United States (Nevada) + US_NV, + #[cfg(feature = "US")] + /// United States (New York) + US_NY, + #[cfg(feature = "US")] + /// United States (Ohio) + US_OH, + #[cfg(feature = "US")] + /// United States (Oklahoma) + US_OK, + #[cfg(feature = "US")] + /// United States (Oregon) + US_OR, + #[cfg(feature = "US")] + /// United States (Pennsylvania) + US_PA, + #[cfg(feature = "US")] + /// United States (Puerto Rico) + US_PR, + #[cfg(feature = "US")] + /// United States (Rhode Island) + US_RI, + #[cfg(feature = "US")] + /// United States (South Carolina) + US_SC, + #[cfg(feature = "US")] + /// United States (South Dakota) + US_SD, + #[cfg(feature = "US")] + /// United States (Tennessee) + US_TN, + #[cfg(feature = "US")] + /// United States (Texas) + US_TX, + #[cfg(feature = "US")] + /// United States (United States Minor Outlying Islands) + US_UM, + #[cfg(feature = "US")] + /// United States (Utah) + US_UT, + #[cfg(feature = "US")] + /// United States (Virginia) + US_VA, + #[cfg(feature = "US")] + /// United States (Virgin Islands, U.S..) + US_VI, + #[cfg(feature = "US")] + /// United States (Vermont) + US_VT, + #[cfg(feature = "US")] + /// United States (Washington) + US_WA, + #[cfg(feature = "US")] + /// United States (Wisconsin) + US_WI, + #[cfg(feature = "US")] + /// United States (West Virginia) + US_WV, + #[cfg(feature = "US")] + /// United States (Wyoming) + US_WY, #[cfg(feature = "UY")] /// Uruguay UY, @@ -316,6 +539,7 @@ impl std::fmt::Display for Country { } impl AsRef for Country { + #[allow(clippy::too_many_lines)] fn as_ref(&self) -> &str { match self { #[cfg(feature = "AO")] @@ -388,6 +612,40 @@ impl AsRef for Country { Country::GE => "GE", #[cfg(feature = "DE")] Country::DE => "DE", + #[cfg(feature = "DE")] + Country::DE_BB => "DE_BB", + #[cfg(feature = "DE")] + Country::DE_BE => "DE_BE", + #[cfg(feature = "DE")] + Country::DE_BW => "DE_BW", + #[cfg(feature = "DE")] + Country::DE_BY => "DE_BY", + #[cfg(feature = "DE")] + Country::DE_BYP => "DE_BYP", + #[cfg(feature = "DE")] + Country::DE_HB => "DE_HB", + #[cfg(feature = "DE")] + Country::DE_HE => "DE_HE", + #[cfg(feature = "DE")] + Country::DE_HH => "DE_HH", + #[cfg(feature = "DE")] + Country::DE_MV => "DE_MV", + #[cfg(feature = "DE")] + Country::DE_NI => "DE_NI", + #[cfg(feature = "DE")] + Country::DE_NW => "DE_NW", + #[cfg(feature = "DE")] + Country::DE_RP => "DE_RP", + #[cfg(feature = "DE")] + Country::DE_SH => "DE_SH", + #[cfg(feature = "DE")] + Country::DE_SL => "DE_SL", + #[cfg(feature = "DE")] + Country::DE_SN => "DE_SN", + #[cfg(feature = "DE")] + Country::DE_ST => "DE_ST", + #[cfg(feature = "DE")] + Country::DE_TH => "DE_TH", #[cfg(feature = "GR")] Country::GR => "GR", #[cfg(feature = "HN")] @@ -508,6 +766,120 @@ impl AsRef for Country { Country::GB => "GB", #[cfg(feature = "US")] Country::US => "US", + #[cfg(feature = "US")] + Country::US_AK => "US_AK", + #[cfg(feature = "US")] + Country::US_AL => "US_AL", + #[cfg(feature = "US")] + Country::US_AR => "US_AR", + #[cfg(feature = "US")] + Country::US_AS => "US_AS", + #[cfg(feature = "US")] + Country::US_AZ => "US_AZ", + #[cfg(feature = "US")] + Country::US_CA => "US_CA", + #[cfg(feature = "US")] + Country::US_CO => "US_CO", + #[cfg(feature = "US")] + Country::US_CT => "US_CT", + #[cfg(feature = "US")] + Country::US_DC => "US_DC", + #[cfg(feature = "US")] + Country::US_DE => "US_DE", + #[cfg(feature = "US")] + Country::US_FL => "US_FL", + #[cfg(feature = "US")] + Country::US_GA => "US_GA", + #[cfg(feature = "US")] + Country::US_GU => "US_GU", + #[cfg(feature = "US")] + Country::US_HI => "US_HI", + #[cfg(feature = "US")] + Country::US_IA => "US_IA", + #[cfg(feature = "US")] + Country::US_ID => "US_ID", + #[cfg(feature = "US")] + Country::US_IL => "US_IL", + #[cfg(feature = "US")] + Country::US_IN => "US_IN", + #[cfg(feature = "US")] + Country::US_KS => "US_KS", + #[cfg(feature = "US")] + Country::US_KY => "US_KY", + #[cfg(feature = "US")] + Country::US_LA => "US_LA", + #[cfg(feature = "US")] + Country::US_MA => "US_MA", + #[cfg(feature = "US")] + Country::US_MD => "US_MD", + #[cfg(feature = "US")] + Country::US_ME => "US_ME", + #[cfg(feature = "US")] + Country::US_MI => "US_MI", + #[cfg(feature = "US")] + Country::US_MN => "US_MN", + #[cfg(feature = "US")] + Country::US_MO => "US_MO", + #[cfg(feature = "US")] + Country::US_MP => "US_MP", + #[cfg(feature = "US")] + Country::US_MS => "US_MS", + #[cfg(feature = "US")] + Country::US_MT => "US_MT", + #[cfg(feature = "US")] + Country::US_NC => "US_NC", + #[cfg(feature = "US")] + Country::US_ND => "US_ND", + #[cfg(feature = "US")] + Country::US_NE => "US_NE", + #[cfg(feature = "US")] + Country::US_NH => "US_NH", + #[cfg(feature = "US")] + Country::US_NJ => "US_NJ", + #[cfg(feature = "US")] + Country::US_NM => "US_NM", + #[cfg(feature = "US")] + Country::US_NV => "US_NV", + #[cfg(feature = "US")] + Country::US_NY => "US_NY", + #[cfg(feature = "US")] + Country::US_OH => "US_OH", + #[cfg(feature = "US")] + Country::US_OK => "US_OK", + #[cfg(feature = "US")] + Country::US_OR => "US_OR", + #[cfg(feature = "US")] + Country::US_PA => "US_PA", + #[cfg(feature = "US")] + Country::US_PR => "US_PR", + #[cfg(feature = "US")] + Country::US_RI => "US_RI", + #[cfg(feature = "US")] + Country::US_SC => "US_SC", + #[cfg(feature = "US")] + Country::US_SD => "US_SD", + #[cfg(feature = "US")] + Country::US_TN => "US_TN", + #[cfg(feature = "US")] + Country::US_TX => "US_TX", + #[cfg(feature = "US")] + Country::US_UM => "US_UM", + #[cfg(feature = "US")] + Country::US_UT => "US_UT", + #[cfg(feature = "US")] + Country::US_VA => "US_VA", + #[cfg(feature = "US")] + Country::US_VI => "US_VI", + #[cfg(feature = "US")] + Country::US_VT => "US_VT", + #[cfg(feature = "US")] + Country::US_WA => "US_WA", + #[cfg(feature = "US")] + Country::US_WI => "US_WI", + #[cfg(feature = "US")] + Country::US_WV => "US_WV", + #[cfg(feature = "US")] + Country::US_WY => "US_WY", #[cfg(feature = "UY")] Country::UY => "UY", #[cfg(feature = "UZ")] @@ -527,6 +899,7 @@ impl AsRef for Country { impl std::str::FromStr for Country { type Err = Error; + #[allow(clippy::too_many_lines)] fn from_str(s: &str) -> std::result::Result { Ok(match s { #[cfg(feature = "AO")] @@ -599,6 +972,40 @@ impl std::str::FromStr for Country { "GE" => Country::GE, #[cfg(feature = "DE")] "DE" => Country::DE, + #[cfg(feature = "DE")] + "DE_BB" => Country::DE_BB, + #[cfg(feature = "DE")] + "DE_BE" => Country::DE_BE, + #[cfg(feature = "DE")] + "DE_BW" => Country::DE_BW, + #[cfg(feature = "DE")] + "DE_BY" => Country::DE_BY, + #[cfg(feature = "DE")] + "DE_BYP" => Country::DE_BYP, + #[cfg(feature = "DE")] + "DE_HB" => Country::DE_HB, + #[cfg(feature = "DE")] + "DE_HE" => Country::DE_HE, + #[cfg(feature = "DE")] + "DE_HH" => Country::DE_HH, + #[cfg(feature = "DE")] + "DE_MV" => Country::DE_MV, + #[cfg(feature = "DE")] + "DE_NI" => Country::DE_NI, + #[cfg(feature = "DE")] + "DE_NW" => Country::DE_NW, + #[cfg(feature = "DE")] + "DE_RP" => Country::DE_RP, + #[cfg(feature = "DE")] + "DE_SH" => Country::DE_SH, + #[cfg(feature = "DE")] + "DE_SL" => Country::DE_SL, + #[cfg(feature = "DE")] + "DE_SN" => Country::DE_SN, + #[cfg(feature = "DE")] + "DE_ST" => Country::DE_ST, + #[cfg(feature = "DE")] + "DE_TH" => Country::DE_TH, #[cfg(feature = "GR")] "GR" => Country::GR, #[cfg(feature = "HN")] @@ -719,6 +1126,120 @@ impl std::str::FromStr for Country { "GB" => Country::GB, #[cfg(feature = "US")] "US" => Country::US, + #[cfg(feature = "US")] + "US_AK" => Country::US_AK, + #[cfg(feature = "US")] + "US_AL" => Country::US_AL, + #[cfg(feature = "US")] + "US_AR" => Country::US_AR, + #[cfg(feature = "US")] + "US_AS" => Country::US_AS, + #[cfg(feature = "US")] + "US_AZ" => Country::US_AZ, + #[cfg(feature = "US")] + "US_CA" => Country::US_CA, + #[cfg(feature = "US")] + "US_CO" => Country::US_CO, + #[cfg(feature = "US")] + "US_CT" => Country::US_CT, + #[cfg(feature = "US")] + "US_DC" => Country::US_DC, + #[cfg(feature = "US")] + "US_DE" => Country::US_DE, + #[cfg(feature = "US")] + "US_FL" => Country::US_FL, + #[cfg(feature = "US")] + "US_GA" => Country::US_GA, + #[cfg(feature = "US")] + "US_GU" => Country::US_GU, + #[cfg(feature = "US")] + "US_HI" => Country::US_HI, + #[cfg(feature = "US")] + "US_IA" => Country::US_IA, + #[cfg(feature = "US")] + "US_ID" => Country::US_ID, + #[cfg(feature = "US")] + "US_IL" => Country::US_IL, + #[cfg(feature = "US")] + "US_IN" => Country::US_IN, + #[cfg(feature = "US")] + "US_KS" => Country::US_KS, + #[cfg(feature = "US")] + "US_KY" => Country::US_KY, + #[cfg(feature = "US")] + "US_LA" => Country::US_LA, + #[cfg(feature = "US")] + "US_MA" => Country::US_MA, + #[cfg(feature = "US")] + "US_MD" => Country::US_MD, + #[cfg(feature = "US")] + "US_ME" => Country::US_ME, + #[cfg(feature = "US")] + "US_MI" => Country::US_MI, + #[cfg(feature = "US")] + "US_MN" => Country::US_MN, + #[cfg(feature = "US")] + "US_MO" => Country::US_MO, + #[cfg(feature = "US")] + "US_MP" => Country::US_MP, + #[cfg(feature = "US")] + "US_MS" => Country::US_MS, + #[cfg(feature = "US")] + "US_MT" => Country::US_MT, + #[cfg(feature = "US")] + "US_NC" => Country::US_NC, + #[cfg(feature = "US")] + "US_ND" => Country::US_ND, + #[cfg(feature = "US")] + "US_NE" => Country::US_NE, + #[cfg(feature = "US")] + "US_NH" => Country::US_NH, + #[cfg(feature = "US")] + "US_NJ" => Country::US_NJ, + #[cfg(feature = "US")] + "US_NM" => Country::US_NM, + #[cfg(feature = "US")] + "US_NV" => Country::US_NV, + #[cfg(feature = "US")] + "US_NY" => Country::US_NY, + #[cfg(feature = "US")] + "US_OH" => Country::US_OH, + #[cfg(feature = "US")] + "US_OK" => Country::US_OK, + #[cfg(feature = "US")] + "US_OR" => Country::US_OR, + #[cfg(feature = "US")] + "US_PA" => Country::US_PA, + #[cfg(feature = "US")] + "US_PR" => Country::US_PR, + #[cfg(feature = "US")] + "US_RI" => Country::US_RI, + #[cfg(feature = "US")] + "US_SC" => Country::US_SC, + #[cfg(feature = "US")] + "US_SD" => Country::US_SD, + #[cfg(feature = "US")] + "US_TN" => Country::US_TN, + #[cfg(feature = "US")] + "US_TX" => Country::US_TX, + #[cfg(feature = "US")] + "US_UM" => Country::US_UM, + #[cfg(feature = "US")] + "US_UT" => Country::US_UT, + #[cfg(feature = "US")] + "US_VA" => Country::US_VA, + #[cfg(feature = "US")] + "US_VI" => Country::US_VI, + #[cfg(feature = "US")] + "US_VT" => Country::US_VT, + #[cfg(feature = "US")] + "US_WA" => Country::US_WA, + #[cfg(feature = "US")] + "US_WI" => Country::US_WI, + #[cfg(feature = "US")] + "US_WV" => Country::US_WV, + #[cfg(feature = "US")] + "US_WY" => Country::US_WY, #[cfg(feature = "UY")] "UY" => Country::UY, #[cfg(feature = "UZ")] @@ -735,3 +1256,88 @@ impl std::str::FromStr for Country { }) } } + +impl Country { + #[must_use] + pub fn country_from_subdivision(subdivision: Country) -> Option { + Some(match subdivision { + #[cfg(feature = "DE")] + Country::DE_BB + | Country::DE_BE + | Country::DE_BW + | Country::DE_BY + | Country::DE_BYP + | Country::DE_HB + | Country::DE_HE + | Country::DE_HH + | Country::DE_MV + | Country::DE_NI + | Country::DE_NW + | Country::DE_RP + | Country::DE_SH + | Country::DE_SL + | Country::DE_SN + | Country::DE_ST + | Country::DE_TH => Country::DE, + #[cfg(feature = "US")] + Country::US_AK + | Country::US_AL + | Country::US_AR + | Country::US_AS + | Country::US_AZ + | Country::US_CA + | Country::US_CO + | Country::US_CT + | Country::US_DC + | Country::US_DE + | Country::US_FL + | Country::US_GA + | Country::US_GU + | Country::US_HI + | Country::US_IA + | Country::US_ID + | Country::US_IL + | Country::US_IN + | Country::US_KS + | Country::US_KY + | Country::US_LA + | Country::US_MA + | Country::US_MD + | Country::US_ME + | Country::US_MI + | Country::US_MN + | Country::US_MO + | Country::US_MP + | Country::US_MS + | Country::US_MT + | Country::US_NC + | Country::US_ND + | Country::US_NE + | Country::US_NH + | Country::US_NJ + | Country::US_NM + | Country::US_NV + | Country::US_NY + | Country::US_OH + | Country::US_OK + | Country::US_OR + | Country::US_PA + | Country::US_PR + | Country::US_RI + | Country::US_SC + | Country::US_SD + | Country::US_TN + | Country::US_TX + | Country::US_UM + | Country::US_UT + | Country::US_VA + | Country::US_VI + | Country::US_VT + | Country::US_WA + | Country::US_WI + | Country::US_WV + | Country::US_WY => Country::US, + _ => return None, + }) + } +} diff --git a/src/data/ae.rs b/src/data/ae.rs index 5f64582..51694a4 100644 --- a/src/data/ae.rs +++ b/src/data/ae.rs @@ -1,17 +1,24 @@ //! United Arab Emirates +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "United Arab Emirates"; +const COUNTY_CODE: Country = Country::AE; + /// Generate holiday map for United Arab Emirates. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2000, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2000, 12, 3)?, "اليوم الوطني"), @@ -57,14 +64,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2001, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2001, 12, 3)?, "اليوم الوطني"), @@ -101,14 +108,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2002, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2002, 12, 3)?, "اليوم الوطني"), @@ -145,14 +152,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2003, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2003, 12, 3)?, "اليوم الوطني"), @@ -189,14 +196,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2004, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2004, 12, 3)?, "اليوم الوطني"), @@ -233,14 +240,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2005, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2005, 12, 3)?, "اليوم الوطني"), @@ -274,14 +281,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2006, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2006, 12, 3)?, "اليوم الوطني"), @@ -320,14 +327,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "(تقدير) عطلة عيد الأضحى; رأس السنة الميلادية", @@ -371,14 +378,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2008, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2008, 12, 3)?, "اليوم الوطني"), @@ -419,14 +426,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2009, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2009, 12, 3)?, "اليوم الوطني"), @@ -463,14 +470,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2010, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2010, 12, 3)?, "اليوم الوطني"), @@ -504,14 +511,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2011, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2011, 12, 3)?, "اليوم الوطني"), @@ -548,14 +555,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2012, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2012, 12, 3)?, "اليوم الوطني"), @@ -592,14 +599,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2013, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2013, 12, 3)?, "اليوم الوطني"), @@ -633,14 +640,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2014, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2014, 12, 3)?, "اليوم الوطني"), @@ -677,14 +684,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2015, 11, 30)?, "يوم الشهيد"), (NaiveDate::from_ymd_res(2015, 12, 2)?, "اليوم الوطني"), @@ -726,14 +733,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2016, 11, 30)?, "يوم الشهيد"), (NaiveDate::from_ymd_res(2016, 12, 2)?, "اليوم الوطني"), @@ -768,14 +775,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2017, 11, 30)?, @@ -794,14 +801,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 4, 23)?, "ليلة المعراج"), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2018, 11, 30)?, "يوم الشهيد"), (NaiveDate::from_ymd_res(2018, 12, 2)?, "اليوم الوطني"), @@ -818,14 +825,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 11, 19)?, "عيد المولد النبوي"), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2019, 12, 1)?, "يوم الشهيد"), (NaiveDate::from_ymd_res(2019, 12, 2)?, "اليوم الوطني"), @@ -842,14 +849,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 11, 9)?, "عيد المولد النبوي"), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2020, 12, 1)?, "يوم الشهيد"), (NaiveDate::from_ymd_res(2020, 12, 2)?, "اليوم الوطني"), @@ -866,14 +873,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 10, 29)?, "عيد المولد النبوي"), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2021, 12, 1)?, "يوم الشهيد"), (NaiveDate::from_ymd_res(2021, 12, 2)?, "اليوم الوطني"), @@ -890,14 +897,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 10, 21)?, "عيد المولد النبوي"), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2022, 12, 1)?, "يوم الشهيد"), (NaiveDate::from_ymd_res(2022, 12, 2)?, "اليوم الوطني"), @@ -914,14 +921,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 10, 8)?, "عيد المولد النبوي"), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2023, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2023, 12, 3)?, "اليوم الوطني"), @@ -937,14 +944,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 9, 29)?, "عيد المولد النبوي"), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2024, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2024, 12, 3)?, "اليوم الوطني"), @@ -972,14 +979,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2025, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2025, 12, 3)?, "اليوم الوطني"), @@ -1016,14 +1023,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2026, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2026, 12, 3)?, "اليوم الوطني"), @@ -1060,14 +1067,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2027, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2027, 12, 3)?, "اليوم الوطني"), @@ -1104,14 +1111,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2028, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2028, 12, 3)?, "اليوم الوطني"), @@ -1148,14 +1155,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2029, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2029, 12, 3)?, "اليوم الوطني"), @@ -1192,14 +1199,14 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2030, 12, 2)?, "اليوم الوطني"), (NaiveDate::from_ymd_res(2030, 12, 3)?, "اليوم الوطني"), @@ -1236,8 +1243,8 @@ pub fn build( ), ], &mut map, - Country::AE, - "United Arab Emirates", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/am.rs b/src/data/am.rs index e864820..fcdd2f7 100644 --- a/src/data/am.rs +++ b/src/data/am.rs @@ -1,17 +1,24 @@ //! Armenia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Armenia"; +const COUNTY_CODE: Country = Country::AM; + /// Generate holiday map for Armenia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2000, 1, 2)?, "Նոր տարվա օր"), ( @@ -37,14 +44,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2001, 1, 2)?, "Նոր տարվա օր"), ( @@ -74,14 +81,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2002, 1, 2)?, "Նոր տարվա օր"), ( @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2003, 1, 2)?, "Նոր տարվա օր"), ( @@ -135,14 +142,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2004, 1, 2)?, "Նոր տարվա օր"), ( @@ -166,14 +173,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2005, 1, 2)?, "Նոր տարվա օր"), ( @@ -197,14 +204,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2006, 1, 2)?, "Նոր տարվա օր"), ( @@ -228,14 +235,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2007, 1, 2)?, "Նոր տարվա օր"), ( @@ -259,14 +266,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "Նոր տարվա օր"), ( @@ -290,14 +297,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "Նոր տարվա օր"), ( @@ -321,14 +328,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "Նոր տարվա օր"), ( @@ -356,14 +363,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "Նոր տարվա օր"), ( @@ -391,14 +398,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2012, 1, 2)?, "Նոր տարվա օր"), ( @@ -426,14 +433,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2013, 1, 2)?, "Նոր տարվա օր"), ( @@ -461,14 +468,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2014, 1, 2)?, "Նոր տարվա օր"), ( @@ -496,14 +503,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2015, 1, 2)?, "Նոր տարվա օր"), ( @@ -531,14 +538,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2016, 1, 2)?, "Նոր տարվա օր"), ( @@ -566,14 +573,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "Նոր տարվա օր"), ( @@ -601,14 +608,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "Նոր տարվա օր"), ( @@ -636,14 +643,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "Նոր տարվա օր"), ( @@ -671,14 +678,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "Նոր տարվա օր"), ( @@ -706,14 +713,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "Նոր տարվա օր"), ( @@ -741,14 +748,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "Նոր տարվա օր"), ( @@ -772,14 +779,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "Նոր տարվա օր"), ( @@ -803,14 +810,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "Նոր տարվա օր"), ( @@ -834,14 +841,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "Նոր տարվա օր"), ( @@ -865,14 +872,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "Նոր տարվա օր"), ( @@ -896,14 +903,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "Նոր տարվա օր"), ( @@ -927,14 +934,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "Նոր տարվա օր"), ( @@ -958,14 +965,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "Նոր տարվա օր"), ( @@ -989,14 +996,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Նոր տարվա օր"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "Նոր տարվա օր"), ( @@ -1020,8 +1027,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 31)?, "Նոր տարվա գիշեր"), ], &mut map, - Country::AM, - "Armenia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ao.rs b/src/data/ao.rs index 5206bfb..1f0276f 100644 --- a/src/data/ao.rs +++ b/src/data/ao.rs @@ -1,17 +1,24 @@ //! Angola +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Angola"; +const COUNTY_CODE: Country = Country::AO; + /// Generate holiday map for Angola. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2000, 1, 4)?, @@ -51,14 +58,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2001, 1, 4)?, @@ -103,14 +110,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2002, 1, 4)?, @@ -147,14 +154,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2003, 1, 4)?, @@ -207,14 +214,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2004, 1, 4)?, @@ -263,14 +270,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2005, 1, 4)?, @@ -319,14 +326,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -375,14 +382,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2007, 1, 4)?, @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2008, 1, 4)?, @@ -491,14 +498,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2009, 1, 4)?, @@ -547,14 +554,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2010, 1, 4)?, @@ -599,14 +606,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Dia do Natal"), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2011, 1, 4)?, @@ -648,14 +655,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2012, 2, 4)?, @@ -694,14 +701,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2013, 2, 4)?, @@ -736,14 +743,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2014, 2, 4)?, @@ -778,14 +785,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2015, 2, 4)?, @@ -824,14 +831,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2016, 2, 4)?, @@ -870,14 +877,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2017, 2, 4)?, @@ -920,14 +927,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2018, 12, 31)?, @@ -974,14 +981,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2019, 2, 4)?, @@ -1032,14 +1039,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2020, 2, 4)?, @@ -1090,14 +1097,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2021, 2, 4)?, @@ -1156,14 +1163,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2022, 2, 4)?, @@ -1210,14 +1217,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2023, 2, 4)?, @@ -1272,14 +1279,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2024, 2, 4)?, @@ -1330,14 +1337,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2025, 2, 4)?, @@ -1396,14 +1403,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2026, 1, 2)?, @@ -1454,14 +1461,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2027, 2, 4)?, @@ -1520,14 +1527,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2028, 2, 4)?, @@ -1582,14 +1589,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2029, 12, 31)?, @@ -1648,14 +1655,14 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Dia do Ano Novo"), ( NaiveDate::from_ymd_res(2030, 2, 4)?, @@ -1706,8 +1713,8 @@ pub fn build( ), ], &mut map, - Country::AO, - "Angola", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ar.rs b/src/data/ar.rs index b366805..99f4612 100644 --- a/src/data/ar.rs +++ b/src/data/ar.rs @@ -1,40 +1,46 @@ //! Argentina +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Argentina"; +const COUNTY_CODE: Country = Country::AR; + /// Generate holiday map for Argentina. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( - years, - 2000, - vec![ - - (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), - (NaiveDate::from_ymd_res(2000, 4, 2)?, "Día del Veterano de Guerra"), - (NaiveDate::from_ymd_res(2000, 4, 21)?, "Viernes Santo"), - (NaiveDate::from_ymd_res(2000, 5, 1)?, "Día del Trabajo"), - (NaiveDate::from_ymd_res(2000, 5, 25)?, "Día de la Revolución de Mayo"), - (NaiveDate::from_ymd_res(2000, 6, 10)?, "Día de los Derechos Argentinos sobre las Islas Malvinas, Sandwich y del Atlántico Sur"), - (NaiveDate::from_ymd_res(2000, 6, 19)?, "Paso a la Inmortalidad del General Don Manuel Belgrano"), - (NaiveDate::from_ymd_res(2000, 7, 9)?, "Día de la Independencia"), - (NaiveDate::from_ymd_res(2000, 12, 8)?, "Inmaculada Concepción de María"), - (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), - (NaiveDate::from_ymd_res(2000, 8, 21)?, "Paso a la Inmortalidad del General Don José de San Martin"), - (NaiveDate::from_ymd_res(2000, 10, 12)?, "Día de la Raza"), - ], - &mut map, - Country::AR, - "Argentina", - ); + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), + (NaiveDate::from_ymd_res(2000, 4, 2)?, "Día del Veterano de Guerra"), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Viernes Santo"), + (NaiveDate::from_ymd_res(2000, 5, 1)?, "Día del Trabajo"), + (NaiveDate::from_ymd_res(2000, 5, 25)?, "Día de la Revolución de Mayo"), + (NaiveDate::from_ymd_res(2000, 6, 10)?, "Día de los Derechos Argentinos sobre las Islas Malvinas, Sandwich y del Atlántico Sur"), + (NaiveDate::from_ymd_res(2000, 6, 19)?, "Paso a la Inmortalidad del General Don Manuel Belgrano"), + (NaiveDate::from_ymd_res(2000, 7, 9)?, "Día de la Independencia"), + (NaiveDate::from_ymd_res(2000, 12, 8)?, "Inmaculada Concepción de María"), + (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), + (NaiveDate::from_ymd_res(2000, 8, 21)?, "Paso a la Inmortalidad del General Don José de San Martin"), + (NaiveDate::from_ymd_res(2000, 10, 12)?, "Día de la Raza"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2001, 4, 2)?, @@ -66,14 +72,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2002, 4, 2)?, @@ -105,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2003, 4, 2)?, @@ -144,14 +150,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2004, 4, 2)?, @@ -183,14 +189,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2005, 4, 2)?, @@ -222,14 +228,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2006, 3, 24)?, @@ -265,14 +271,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2007, 3, 24)?, @@ -308,14 +314,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2008, 3, 24)?, @@ -351,14 +357,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2009, 3, 24)?, @@ -394,14 +400,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 10, 12)?, "Día de la Raza"), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2010, 3, 24)?, @@ -443,14 +449,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2011, 3, 7)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2011, 3, 8)?, "Día de Carnaval"), @@ -503,14 +509,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2012, 2, 20)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2012, 2, 21)?, "Día de Carnaval"), @@ -571,44 +577,43 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( - years, - 2013, - vec![ - - (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), - (NaiveDate::from_ymd_res(2013, 2, 11)?, "Día de Carnaval"), - (NaiveDate::from_ymd_res(2013, 2, 12)?, "Día de Carnaval"), - (NaiveDate::from_ymd_res(2013, 3, 24)?, "Día Nacional de la Memoria por la Verdad y la Justicia"), - (NaiveDate::from_ymd_res(2013, 4, 2)?, "Día del Veterano y de los Caidos en la Guerra de Malvinas"), - (NaiveDate::from_ymd_res(2013, 3, 29)?, "Viernes Santo"), - (NaiveDate::from_ymd_res(2013, 5, 1)?, "Día del Trabajo"), - (NaiveDate::from_ymd_res(2013, 5, 25)?, "Día de la Revolución de Mayo"), - (NaiveDate::from_ymd_res(2013, 6, 20)?, "Paso a la Inmortalidad del General Don Manuel Belgrano"), - (NaiveDate::from_ymd_res(2013, 7, 9)?, "Día de la Independencia"), - (NaiveDate::from_ymd_res(2013, 12, 8)?, "Inmaculada Concepción de María"), - (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad"), - (NaiveDate::from_ymd_res(2013, 8, 17)?, "Paso a la Inmortalidad del General Don José de San Martin"), - (NaiveDate::from_ymd_res(2013, 10, 12)?, "Día del Respeto a la Diversidad Cultural"), - (NaiveDate::from_ymd_res(2013, 11, 18)?, "Día de la Soberanía Nacional (observado)"), - (NaiveDate::from_ymd_res(2013, 1, 31)?, "Bicentenario de la sesión inaugural de la Asamblea Nacional Constituyente del año 1813"), - (NaiveDate::from_ymd_res(2013, 2, 20)?, "Bicentenario de la Batalla de Salta"), - (NaiveDate::from_ymd_res(2013, 4, 1)?, "Feriado con fines turísticos"), - (NaiveDate::from_ymd_res(2013, 6, 21)?, "Feriado con fines turísticos"), - ], - &mut map, - Country::AR, - "Argentina", - ); + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), + (NaiveDate::from_ymd_res(2013, 2, 11)?, "Día de Carnaval"), + (NaiveDate::from_ymd_res(2013, 2, 12)?, "Día de Carnaval"), + (NaiveDate::from_ymd_res(2013, 3, 24)?, "Día Nacional de la Memoria por la Verdad y la Justicia"), + (NaiveDate::from_ymd_res(2013, 4, 2)?, "Día del Veterano y de los Caidos en la Guerra de Malvinas"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Viernes Santo"), + (NaiveDate::from_ymd_res(2013, 5, 1)?, "Día del Trabajo"), + (NaiveDate::from_ymd_res(2013, 5, 25)?, "Día de la Revolución de Mayo"), + (NaiveDate::from_ymd_res(2013, 6, 20)?, "Paso a la Inmortalidad del General Don Manuel Belgrano"), + (NaiveDate::from_ymd_res(2013, 7, 9)?, "Día de la Independencia"), + (NaiveDate::from_ymd_res(2013, 12, 8)?, "Inmaculada Concepción de María"), + (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad"), + (NaiveDate::from_ymd_res(2013, 8, 17)?, "Paso a la Inmortalidad del General Don José de San Martin"), + (NaiveDate::from_ymd_res(2013, 10, 12)?, "Día del Respeto a la Diversidad Cultural"), + (NaiveDate::from_ymd_res(2013, 11, 18)?, "Día de la Soberanía Nacional (observado)"), + (NaiveDate::from_ymd_res(2013, 1, 31)?, "Bicentenario de la sesión inaugural de la Asamblea Nacional Constituyente del año 1813"), + (NaiveDate::from_ymd_res(2013, 2, 20)?, "Bicentenario de la Batalla de Salta"), + (NaiveDate::from_ymd_res(2013, 4, 1)?, "Feriado con fines turísticos"), + (NaiveDate::from_ymd_res(2013, 6, 21)?, "Feriado con fines turísticos"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2014, 3, 3)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2014, 3, 4)?, "Día de Carnaval"), @@ -661,14 +666,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2015, 2, 16)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2015, 2, 17)?, "Día de Carnaval"), @@ -721,14 +726,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2016, 2, 9)?, "Día de Carnaval"), @@ -785,14 +790,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2017, 2, 27)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2017, 2, 28)?, "Día de Carnaval"), @@ -841,14 +846,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2018, 2, 12)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2018, 2, 13)?, "Día de Carnaval"), @@ -909,14 +914,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2019, 3, 4)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2019, 3, 5)?, "Día de Carnaval"), @@ -977,14 +982,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2020, 2, 24)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2020, 2, 25)?, "Día de Carnaval"), @@ -1045,14 +1050,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2021, 2, 15)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2021, 2, 16)?, "Día de Carnaval"), @@ -1112,14 +1117,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2022, 2, 28)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2022, 3, 1)?, "Día de Carnaval"), @@ -1181,14 +1186,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2023, 2, 20)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2023, 2, 21)?, "Día de Carnaval"), @@ -1249,14 +1254,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2024, 2, 12)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2024, 2, 13)?, "Día de Carnaval"), @@ -1317,14 +1322,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2025, 3, 3)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2025, 3, 4)?, "Día de Carnaval"), @@ -1373,14 +1378,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2026, 2, 16)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2026, 2, 17)?, "Día de Carnaval"), @@ -1429,14 +1434,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2027, 2, 8)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2027, 2, 9)?, "Día de Carnaval"), @@ -1485,14 +1490,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2028, 2, 28)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2028, 2, 29)?, "Día de Carnaval"), @@ -1541,14 +1546,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2029, 2, 12)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2029, 2, 13)?, "Día de Carnaval"), @@ -1597,14 +1602,14 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2030, 3, 4)?, "Día de Carnaval"), (NaiveDate::from_ymd_res(2030, 3, 5)?, "Día de Carnaval"), @@ -1653,8 +1658,8 @@ pub fn build( ), ], &mut map, - Country::AR, - "Argentina", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/at.rs b/src/data/at.rs index 634af80..9bd9fce 100644 --- a/src/data/at.rs +++ b/src/data/at.rs @@ -1,17 +1,24 @@ //! Austria +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Austria"; +const COUNTY_CODE: Country = Country::AT; + /// Generate holiday map for Austria. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Ostermontag"), @@ -27,14 +34,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Ostermontag"), @@ -50,14 +57,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2002, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Ostermontag"), @@ -73,14 +80,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Ostermontag"), @@ -96,14 +103,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Ostermontag"), @@ -119,14 +126,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Ostermontag"), @@ -142,14 +149,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Ostermontag"), @@ -165,14 +172,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Ostermontag"), @@ -188,14 +195,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2008, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Ostermontag"), @@ -213,14 +220,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Ostermontag"), @@ -236,14 +243,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Ostermontag"), @@ -259,14 +266,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Ostermontag"), @@ -282,14 +289,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Ostermontag"), @@ -305,14 +312,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2013, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Ostermontag"), @@ -328,14 +335,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Ostermontag"), @@ -351,14 +358,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Ostermontag"), @@ -374,14 +381,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Ostermontag"), @@ -397,14 +404,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Ostermontag"), @@ -420,14 +427,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Ostermontag"), @@ -443,14 +450,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2019, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Ostermontag"), @@ -466,14 +473,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Ostermontag"), @@ -489,14 +496,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Ostermontag"), @@ -512,14 +519,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Ostermontag"), @@ -535,14 +542,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2023, 4, 10)?, "Ostermontag"), @@ -558,14 +565,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Ostermontag"), @@ -581,14 +588,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Ostermontag"), @@ -604,14 +611,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Ostermontag"), @@ -627,14 +634,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Ostermontag"), @@ -650,14 +657,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Ostermontag"), @@ -673,14 +680,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Ostermontag"), @@ -696,14 +703,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Ostermontag"), @@ -719,8 +726,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Stefanitag"), ], &mut map, - Country::AT, - "Austria", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/au.rs b/src/data/au.rs index 30f284e..5951e41 100644 --- a/src/data/au.rs +++ b/src/data/au.rs @@ -1,17 +1,24 @@ //! Australia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Australia"; +const COUNTY_CODE: Country = Country::AU; + /// Generate holiday map for Australia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Easter Monday"), (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), @@ -21,14 +28,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Easter Monday"), (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), @@ -38,14 +45,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Easter Monday"), (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), @@ -55,14 +62,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Easter Monday"), (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), @@ -72,14 +79,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Easter Monday"), (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), @@ -89,14 +96,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Easter Monday"), (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), @@ -106,14 +113,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Easter Monday"), (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), @@ -123,14 +130,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Easter Monday"), (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), @@ -140,14 +147,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Easter Monday"), (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), @@ -157,14 +164,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Easter Monday"), (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), @@ -174,14 +181,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Easter Monday"), (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), @@ -191,14 +198,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), ( NaiveDate::from_ymd_res(2011, 4, 25)?, @@ -210,14 +217,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Easter Monday"), (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), @@ -227,14 +234,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Easter Monday"), (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), @@ -244,14 +251,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Easter Monday"), (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), @@ -261,14 +268,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Easter Monday"), (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), @@ -278,14 +285,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Easter Monday"), (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), @@ -295,14 +302,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Easter Monday"), (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), @@ -312,14 +319,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Easter Monday"), (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), @@ -329,14 +336,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Easter Monday"), (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), @@ -346,14 +353,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Easter Monday"), (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), @@ -363,14 +370,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Easter Monday"), (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), @@ -380,14 +387,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Easter Monday"), (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), @@ -401,14 +408,14 @@ pub fn build( ), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), (NaiveDate::from_ymd_res(2023, 4, 10)?, "Easter Monday"), (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), @@ -418,14 +425,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Easter Monday"), (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), @@ -435,14 +442,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Easter Monday"), (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), @@ -452,14 +459,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Easter Monday"), (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), @@ -469,14 +476,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Easter Monday"), (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), @@ -486,14 +493,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Easter Monday"), (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), @@ -503,14 +510,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Easter Monday"), (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), @@ -520,14 +527,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Easter Monday"), (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), @@ -537,8 +544,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::AU, - "Australia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/aw.rs b/src/data/aw.rs index c83cc14..ce08f3d 100644 --- a/src/data/aw.rs +++ b/src/data/aw.rs @@ -1,17 +1,24 @@ //! Aruba +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Aruba"; +const COUNTY_CODE: Country = Country::AW; + /// Generate holiday map for Aruba. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2000, 1, 25)?, "Dia di Betico"), ( @@ -37,14 +44,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2001, 1, 25)?, "Dia di Betico"), ( @@ -70,14 +77,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2002, 1, 25)?, "Dia di Betico"), ( @@ -103,14 +110,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2003, 1, 25)?, "Dia di Betico"), ( @@ -136,14 +143,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2004, 1, 25)?, "Dia di Betico"), ( @@ -169,14 +176,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2005, 1, 25)?, "Dia di Betico"), ( @@ -202,14 +209,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2006, 1, 25)?, "Dia di Betico"), ( @@ -235,14 +242,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2007, 1, 25)?, "Dia di Betico"), ( @@ -268,14 +275,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2008, 1, 25)?, "Dia di Betico"), ( @@ -303,14 +310,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2009, 1, 25)?, "Dia di Betico"), ( @@ -336,14 +343,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2010, 1, 25)?, "Dia di Betico"), ( @@ -369,14 +376,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2011, 1, 25)?, "Dia di Betico"), ( @@ -402,14 +409,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2012, 1, 25)?, "Dia di Betico"), ( @@ -435,14 +442,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2013, 1, 25)?, "Dia di Betico"), ( @@ -468,14 +475,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2014, 1, 25)?, "Dia di Betico"), ( @@ -501,14 +508,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2015, 1, 25)?, "Dia di Betico"), ( @@ -534,14 +541,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2016, 1, 25)?, "Dia di Betico"), ( @@ -567,14 +574,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2017, 1, 25)?, "Dia di Betico"), ( @@ -600,14 +607,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2018, 1, 25)?, "Dia di Betico"), ( @@ -633,14 +640,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2019, 1, 25)?, "Dia di Betico"), ( @@ -666,14 +673,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2020, 1, 25)?, "Dia di Betico"), ( @@ -699,14 +706,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2021, 1, 25)?, "Dia di Betico"), ( @@ -732,14 +739,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2022, 1, 25)?, "Dia di Betico"), ( @@ -765,14 +772,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2023, 1, 25)?, "Dia di Betico"), ( @@ -798,14 +805,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2024, 1, 25)?, "Dia di Betico"), ( @@ -831,14 +838,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2025, 1, 25)?, "Dia di Betico"), ( @@ -864,14 +871,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2026, 1, 25)?, "Dia di Betico"), ( @@ -897,14 +904,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2027, 1, 25)?, "Dia di Betico"), ( @@ -930,14 +937,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2028, 1, 25)?, "Dia di Betico"), ( @@ -963,14 +970,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2029, 1, 25)?, "Dia di Betico"), ( @@ -996,14 +1003,14 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Aña Nobo"), (NaiveDate::from_ymd_res(2030, 1, 25)?, "Dia di Betico"), ( @@ -1029,8 +1036,8 @@ pub fn build( ), ], &mut map, - Country::AW, - "Aruba", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/az.rs b/src/data/az.rs index 4a2f9d2..6f332cf 100644 --- a/src/data/az.rs +++ b/src/data/az.rs @@ -1,17 +1,24 @@ //! Azerbaijan +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Azerbaijan"; +const COUNTY_CODE: Country = Country::AZ; + /// Generate holiday map for Azerbaijan. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2000, 1, 20)?, "Ümumxalq hüzn günü"), (NaiveDate::from_ymd_res(2000, 3, 8)?, "Qadınlar günü"), @@ -52,14 +59,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2001, 1, 20)?, "Ümumxalq hüzn günü"), (NaiveDate::from_ymd_res(2001, 3, 8)?, "Qadınlar günü"), @@ -96,14 +103,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2002, 1, 20)?, "Ümumxalq hüzn günü"), (NaiveDate::from_ymd_res(2002, 3, 8)?, "Qadınlar günü"), @@ -134,14 +141,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 2, 21)?, "Qurban bayrami"), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2003, 1, 20)?, "Ümumxalq hüzn günü"), (NaiveDate::from_ymd_res(2003, 3, 8)?, "Qadınlar günü"), @@ -172,14 +179,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 2, 11)?, "Qurban bayrami"), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2004, 1, 20)?, "Ümumxalq hüzn günü"), (NaiveDate::from_ymd_res(2004, 3, 8)?, "Qadınlar günü"), @@ -210,14 +217,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 2, 1)?, "Qurban bayrami"), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2005, 1, 20)?, "Ümumxalq hüzn günü"), (NaiveDate::from_ymd_res(2005, 3, 8)?, "Qadınlar günü"), @@ -248,14 +255,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 1, 22)?, "Qurban bayrami"), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2006, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2006, 1, 20)?, "Ümumxalq hüzn günü"), @@ -296,47 +303,46 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( - years, - 2007, - vec![ - - (NaiveDate::from_ymd_res(2007, 1, 1)?, "Qurban bayrami; Yeni il bayramı"), - (NaiveDate::from_ymd_res(2007, 1, 2)?, "Yeni il bayramı"), - (NaiveDate::from_ymd_res(2007, 1, 20)?, "Ümumxalq hüzn günü"), - (NaiveDate::from_ymd_res(2007, 3, 8)?, "Qadınlar günü"), - (NaiveDate::from_ymd_res(2007, 3, 20)?, "Novruz bayramı"), - (NaiveDate::from_ymd_res(2007, 3, 21)?, "Novruz bayramı"), - (NaiveDate::from_ymd_res(2007, 3, 22)?, "Novruz bayramı"), - (NaiveDate::from_ymd_res(2007, 3, 23)?, "Novruz bayramı"), - (NaiveDate::from_ymd_res(2007, 3, 24)?, "Novruz bayramı"), - (NaiveDate::from_ymd_res(2007, 5, 9)?, "Faşizm üzərində qələbə günü"), - (NaiveDate::from_ymd_res(2007, 5, 28)?, "Respublika Günü"), - (NaiveDate::from_ymd_res(2007, 6, 15)?, "Azərbaycan xalqının milli qurtuluş günü"), - (NaiveDate::from_ymd_res(2007, 6, 26)?, "Azərbaycan Respublikasının Silahlı Qüvvələri günü"), - (NaiveDate::from_ymd_res(2007, 12, 31)?, "Dünya azərbaycanlılarının həmrəyliyi günü"), - (NaiveDate::from_ymd_res(2007, 1, 3)?, "Dünya azərbaycanlılarının həmrəyliyi günü (müşahidə olunur); Qurban bayrami (müşahidə olunur)"), - (NaiveDate::from_ymd_res(2007, 10, 12)?, "Ramazan bayrami"), - (NaiveDate::from_ymd_res(2007, 10, 13)?, "Ramazan bayrami"), - (NaiveDate::from_ymd_res(2007, 12, 20)?, "Qurban bayrami"), - (NaiveDate::from_ymd_res(2007, 12, 21)?, "Qurban bayrami"), - (NaiveDate::from_ymd_res(2007, 3, 26)?, "Novruz bayramı (müşahidə olunur)"), - (NaiveDate::from_ymd_res(2007, 10, 15)?, "Ramazan bayrami (müşahidə olunur)"), - (NaiveDate::from_ymd_res(2007, 1, 4)?, "Qurban bayrami (müşahidə olunur)"), - ], - &mut map, - Country::AZ, - "Azerbaijan", - ); + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 1)?, "Qurban bayrami; Yeni il bayramı"), + (NaiveDate::from_ymd_res(2007, 1, 2)?, "Yeni il bayramı"), + (NaiveDate::from_ymd_res(2007, 1, 20)?, "Ümumxalq hüzn günü"), + (NaiveDate::from_ymd_res(2007, 3, 8)?, "Qadınlar günü"), + (NaiveDate::from_ymd_res(2007, 3, 20)?, "Novruz bayramı"), + (NaiveDate::from_ymd_res(2007, 3, 21)?, "Novruz bayramı"), + (NaiveDate::from_ymd_res(2007, 3, 22)?, "Novruz bayramı"), + (NaiveDate::from_ymd_res(2007, 3, 23)?, "Novruz bayramı"), + (NaiveDate::from_ymd_res(2007, 3, 24)?, "Novruz bayramı"), + (NaiveDate::from_ymd_res(2007, 5, 9)?, "Faşizm üzərində qələbə günü"), + (NaiveDate::from_ymd_res(2007, 5, 28)?, "Respublika Günü"), + (NaiveDate::from_ymd_res(2007, 6, 15)?, "Azərbaycan xalqının milli qurtuluş günü"), + (NaiveDate::from_ymd_res(2007, 6, 26)?, "Azərbaycan Respublikasının Silahlı Qüvvələri günü"), + (NaiveDate::from_ymd_res(2007, 12, 31)?, "Dünya azərbaycanlılarının həmrəyliyi günü"), + (NaiveDate::from_ymd_res(2007, 1, 3)?, "Dünya azərbaycanlılarının həmrəyliyi günü (müşahidə olunur); Qurban bayrami (müşahidə olunur)"), + (NaiveDate::from_ymd_res(2007, 10, 12)?, "Ramazan bayrami"), + (NaiveDate::from_ymd_res(2007, 10, 13)?, "Ramazan bayrami"), + (NaiveDate::from_ymd_res(2007, 12, 20)?, "Qurban bayrami"), + (NaiveDate::from_ymd_res(2007, 12, 21)?, "Qurban bayrami"), + (NaiveDate::from_ymd_res(2007, 3, 26)?, "Novruz bayramı (müşahidə olunur)"), + (NaiveDate::from_ymd_res(2007, 10, 15)?, "Ramazan bayrami (müşahidə olunur)"), + (NaiveDate::from_ymd_res(2007, 1, 4)?, "Qurban bayrami (müşahidə olunur)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2008, 1, 20)?, "Ümumxalq hüzn günü"), @@ -385,14 +391,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2009, 1, 20)?, "Ümumxalq hüzn günü"), @@ -449,14 +455,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2010, 1, 20)?, "Ümumxalq hüzn günü"), @@ -513,14 +519,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2011, 1, 20)?, "Ümumxalq hüzn günü"), @@ -585,14 +591,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2012, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2012, 1, 20)?, "Ümumxalq hüzn günü"), @@ -645,14 +651,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2013, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2013, 1, 20)?, "Ümumxalq hüzn günü"), @@ -713,14 +719,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2014, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2014, 1, 20)?, "Ümumxalq hüzn günü"), @@ -793,14 +799,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2015, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2015, 1, 20)?, "Ümumxalq hüzn günü"), @@ -857,14 +863,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2016, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2016, 1, 20)?, "Ümumxalq hüzn günü"), @@ -917,14 +923,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2017, 1, 20)?, "Ümumxalq hüzn günü"), @@ -980,14 +986,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2018, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1043,14 +1049,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2019, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1107,14 +1113,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2020, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1191,14 +1197,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2021, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1268,14 +1274,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2022, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1349,14 +1355,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2023, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1422,14 +1428,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2024, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1497,14 +1503,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2025, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1586,14 +1592,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2026, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1660,14 +1666,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2027, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1741,14 +1747,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2028, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1822,14 +1828,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2029, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1887,14 +1893,14 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "Yeni il bayramı"), (NaiveDate::from_ymd_res(2030, 1, 20)?, "Ümumxalq hüzn günü"), @@ -1968,8 +1974,8 @@ pub fn build( ), ], &mut map, - Country::AZ, - "Azerbaijan", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ba.rs b/src/data/ba.rs index 3c6fae2..14b83e6 100644 --- a/src/data/ba.rs +++ b/src/data/ba.rs @@ -1,17 +1,24 @@ //! Bosnia and Herzegovina +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Bosnia and Herzegovina"; +const COUNTY_CODE: Country = Country::BA; + /// Generate holiday map for Bosnia and Herzegovina. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 4, 28)?, "Veliki petak (Pravoslavni)", @@ -46,14 +53,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 4, 13)?, "Veliki petak (Pravoslavni)", @@ -78,14 +85,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 5, 3)?, "Veliki petak (Pravoslavni)", @@ -110,14 +117,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 4, 25)?, "Veliki petak (Pravoslavni)", @@ -142,14 +149,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 4, 9)?, "Veliki petak (Pravoslavni)", @@ -174,14 +181,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 4, 29)?, "Veliki petak (Pravoslavni)", @@ -206,14 +213,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 4, 21)?, "Veliki petak (Pravoslavni)", @@ -239,14 +246,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 4, 6)?, "Veliki petak (Pravoslavni)", @@ -271,14 +278,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 4, 25)?, "Veliki petak (Pravoslavni)", @@ -303,14 +310,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 4, 17)?, "Veliki petak (Pravoslavni)", @@ -335,14 +342,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 4, 2)?, "Veliki petak (Pravoslavni)", @@ -367,14 +374,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 4, 22)?, "Veliki petak (Pravoslavni)", @@ -399,14 +406,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 4, 13)?, "Veliki petak (Pravoslavni)", @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 5, 3)?, "Veliki petak (Pravoslavni)", @@ -463,14 +470,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 4, 18)?, "Veliki petak (Pravoslavni)", @@ -495,14 +502,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 4, 10)?, "Veliki petak (Pravoslavni)", @@ -527,14 +534,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 4, 29)?, "Veliki petak (Pravoslavni)", @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 4, 14)?, "Veliki petak (Pravoslavni)", @@ -591,14 +598,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 4, 6)?, "Veliki petak (Pravoslavni)", @@ -623,14 +630,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 4, 26)?, "Veliki petak (Pravoslavni)", @@ -655,14 +662,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 4, 17)?, "Veliki petak (Pravoslavni)", @@ -687,14 +694,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 4, 30)?, "Veliki petak (Pravoslavni)", @@ -719,14 +726,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 4, 22)?, "Veliki petak (Pravoslavni)", @@ -750,14 +757,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 4, 14)?, "Veliki petak (Pravoslavni)", @@ -782,14 +789,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 5, 3)?, "Veliki petak (Pravoslavni)", @@ -817,14 +824,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 4, 18)?, "Veliki petak (Pravoslavni)", @@ -855,14 +862,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 4, 10)?, "Veliki petak (Pravoslavni)", @@ -893,14 +900,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 4, 30)?, "Veliki petak (Pravoslavni)", @@ -931,14 +938,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 4, 14)?, "Veliki petak (Pravoslavni)", @@ -969,14 +976,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 4, 6)?, "Veliki petak (Pravoslavni)", @@ -1007,14 +1014,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 4, 26)?, "Veliki petak (Pravoslavni)", @@ -1045,8 +1052,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Božić (Katolički)"), ], &mut map, - Country::BA, - "Bosnia and Herzegovina", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/bd.rs b/src/data/bd.rs index 23f7981..9a4f4d1 100644 --- a/src/data/bd.rs +++ b/src/data/bd.rs @@ -1,17 +1,24 @@ //! Bangladesh +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Bangladesh"; +const COUNTY_CODE: Country = Country::BD; + /// Generate holiday map for Bangladesh. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 2, 21)?, "International Mother's language Day", @@ -33,14 +40,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 2, 21)?, "International Mother's language Day", @@ -62,14 +69,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 2, 21)?, "International Mother's language Day", @@ -91,14 +98,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 2, 21)?, "International Mother's language Day", @@ -120,14 +127,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 2, 21)?, "International Mother's language Day", @@ -149,14 +156,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 2, 21)?, "International Mother's language Day", @@ -178,14 +185,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 2, 21)?, "International Mother's language Day", @@ -207,14 +214,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 2, 21)?, "International Mother's language Day", @@ -236,14 +243,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 2, 21)?, "International Mother's language Day", @@ -265,14 +272,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 2, 21)?, "International Mother's language Day", @@ -294,14 +301,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 2, 21)?, "International Mother's language Day", @@ -323,14 +330,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 2, 21)?, "International Mother's language Day", @@ -352,14 +359,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 2, 21)?, "International Mother's language Day", @@ -381,14 +388,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 2, 21)?, "International Mother's language Day", @@ -410,14 +417,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 2, 21)?, "International Mother's language Day", @@ -439,14 +446,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 2, 21)?, "International Mother's language Day", @@ -468,14 +475,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 2, 21)?, "International Mother's language Day", @@ -497,14 +504,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 2, 21)?, "International Mother's language Day", @@ -526,14 +533,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 2, 21)?, "International Mother's language Day", @@ -555,14 +562,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 2, 21)?, "International Mother's language Day", @@ -584,14 +591,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 2, 21)?, "International Mother's language Day", @@ -613,14 +620,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 2, 21)?, "International Mother's language Day", @@ -642,14 +649,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 2, 21)?, "International Mother's language Day", @@ -671,14 +678,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 2, 21)?, "International Mother's language Day", @@ -700,14 +707,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 2, 21)?, "International Mother's language Day", @@ -729,14 +736,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 2, 21)?, "International Mother's language Day", @@ -758,14 +765,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 2, 21)?, "International Mother's language Day", @@ -787,14 +794,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 2, 21)?, "International Mother's language Day", @@ -816,14 +823,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 2, 21)?, "International Mother's language Day", @@ -845,14 +852,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 2, 21)?, "International Mother's language Day", @@ -874,14 +881,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 2, 21)?, "International Mother's language Day", @@ -903,8 +910,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 16)?, "Victory Day"), ], &mut map, - Country::BD, - "Bangladesh", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/be.rs b/src/data/be.rs index ddb3d55..d09dc84 100644 --- a/src/data/be.rs +++ b/src/data/be.rs @@ -1,17 +1,24 @@ //! Belgium +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Belgium"; +const COUNTY_CODE: Country = Country::BE; + /// Generate holiday map for Belgium. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2000, 4, 23)?, "Ostern"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Ostermontag"), @@ -26,14 +33,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2001, 4, 15)?, "Ostern"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Ostermontag"), @@ -48,14 +55,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2002, 3, 31)?, "Ostern"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Ostermontag"), @@ -70,14 +77,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2003, 4, 20)?, "Ostern"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Ostermontag"), @@ -92,14 +99,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2004, 4, 11)?, "Ostern"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Ostermontag"), @@ -114,14 +121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2005, 3, 27)?, "Ostern"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Ostermontag"), @@ -136,14 +143,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2006, 4, 16)?, "Ostern"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Ostermontag"), @@ -158,14 +165,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2007, 4, 8)?, "Ostern"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Ostermontag"), @@ -180,14 +187,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2008, 3, 23)?, "Ostern"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Ostermontag"), @@ -204,14 +211,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2009, 4, 12)?, "Ostern"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Ostermontag"), @@ -226,14 +233,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2010, 4, 4)?, "Ostern"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Ostermontag"), @@ -248,14 +255,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2011, 4, 24)?, "Ostern"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Ostermontag"), @@ -270,14 +277,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2012, 4, 8)?, "Ostern"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Ostermontag"), @@ -292,14 +299,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2013, 3, 31)?, "Ostern"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Ostermontag"), @@ -314,14 +321,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2014, 4, 20)?, "Ostern"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Ostermontag"), @@ -336,14 +343,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2015, 4, 5)?, "Ostern"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Ostermontag"), @@ -358,14 +365,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2016, 3, 27)?, "Ostern"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Ostermontag"), @@ -380,14 +387,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2017, 4, 16)?, "Ostern"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Ostermontag"), @@ -402,14 +409,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2018, 4, 1)?, "Ostern"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Ostermontag"), @@ -424,14 +431,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2019, 4, 21)?, "Ostern"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Ostermontag"), @@ -446,14 +453,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2020, 4, 12)?, "Ostern"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Ostermontag"), @@ -468,14 +475,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2021, 4, 4)?, "Ostern"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Ostermontag"), @@ -490,14 +497,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2022, 4, 17)?, "Ostern"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Ostermontag"), @@ -512,14 +519,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2023, 4, 9)?, "Ostern"), (NaiveDate::from_ymd_res(2023, 4, 10)?, "Ostermontag"), @@ -534,14 +541,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2024, 3, 31)?, "Ostern"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Ostermontag"), @@ -556,14 +563,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2025, 4, 20)?, "Ostern"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Ostermontag"), @@ -578,14 +585,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2026, 4, 5)?, "Ostern"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Ostermontag"), @@ -600,14 +607,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2027, 3, 28)?, "Ostern"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Ostermontag"), @@ -622,14 +629,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2028, 4, 16)?, "Ostern"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Ostermontag"), @@ -644,14 +651,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2029, 4, 1)?, "Ostern"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Ostermontag"), @@ -666,14 +673,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2030, 4, 21)?, "Ostern"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Ostermontag"), @@ -688,8 +695,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Weihnachten"), ], &mut map, - Country::BE, - "Belgium", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/bg.rs b/src/data/bg.rs index c0460bb..10b5cb7 100644 --- a/src/data/bg.rs +++ b/src/data/bg.rs @@ -1,818 +1,794 @@ //! Bulgaria +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Bulgaria"; +const COUNTY_CODE: Country = Country::BG; + /// Generate holiday map for Bulgaria. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( - years, - 2000, - vec![ - - (NaiveDate::from_ymd_res(2000, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2000, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2000, 4, 28)?, "Велики петък"), - (NaiveDate::from_ymd_res(2000, 4, 29)?, "Велика събота"), - (NaiveDate::from_ymd_res(2000, 4, 30)?, "Великден"), - (NaiveDate::from_ymd_res(2000, 5, 1)?, "Великден; Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2000, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2000, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2000, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2000, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2000, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2000, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2000, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2000, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2000, 4, 28)?, "Велики петък"), + (NaiveDate::from_ymd_res(2000, 4, 29)?, "Велика събота"), + (NaiveDate::from_ymd_res(2000, 4, 30)?, "Великден"), + (NaiveDate::from_ymd_res(2000, 5, 1)?, "Великден; Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2000, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2000, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2000, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2000, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2000, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2000, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2000, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2001, - vec![ - - (NaiveDate::from_ymd_res(2001, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2001, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2001, 4, 13)?, "Велики петък"), - (NaiveDate::from_ymd_res(2001, 4, 14)?, "Велика събота"), - (NaiveDate::from_ymd_res(2001, 4, 15)?, "Великден"), - (NaiveDate::from_ymd_res(2001, 4, 16)?, "Великден"), - (NaiveDate::from_ymd_res(2001, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2001, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2001, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2001, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2001, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2001, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2001, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2001, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2001, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Велики петък"), + (NaiveDate::from_ymd_res(2001, 4, 14)?, "Велика събота"), + (NaiveDate::from_ymd_res(2001, 4, 15)?, "Великден"), + (NaiveDate::from_ymd_res(2001, 4, 16)?, "Великден"), + (NaiveDate::from_ymd_res(2001, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2001, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2001, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2001, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2001, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2001, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2001, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2001, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2002, - vec![ - - (NaiveDate::from_ymd_res(2002, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2002, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2002, 5, 3)?, "Велики петък"), - (NaiveDate::from_ymd_res(2002, 5, 4)?, "Велика събота"), - (NaiveDate::from_ymd_res(2002, 5, 5)?, "Великден"), - (NaiveDate::from_ymd_res(2002, 5, 6)?, "Великден; Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2002, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2002, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2002, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2002, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2002, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2002, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2002, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2002, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2002, 5, 3)?, "Велики петък"), + (NaiveDate::from_ymd_res(2002, 5, 4)?, "Велика събота"), + (NaiveDate::from_ymd_res(2002, 5, 5)?, "Великден"), + (NaiveDate::from_ymd_res(2002, 5, 6)?, "Великден; Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2002, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2002, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2002, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2002, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2002, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2002, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2002, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2003, - vec![ - - (NaiveDate::from_ymd_res(2003, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2003, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2003, 4, 25)?, "Велики петък"), - (NaiveDate::from_ymd_res(2003, 4, 26)?, "Велика събота"), - (NaiveDate::from_ymd_res(2003, 4, 27)?, "Великден"), - (NaiveDate::from_ymd_res(2003, 4, 28)?, "Великден"), - (NaiveDate::from_ymd_res(2003, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2003, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2003, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2003, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2003, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2003, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2003, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2003, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2003, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2003, 4, 25)?, "Велики петък"), + (NaiveDate::from_ymd_res(2003, 4, 26)?, "Велика събота"), + (NaiveDate::from_ymd_res(2003, 4, 27)?, "Великден"), + (NaiveDate::from_ymd_res(2003, 4, 28)?, "Великден"), + (NaiveDate::from_ymd_res(2003, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2003, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2003, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2003, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2003, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2003, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2003, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2003, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2004, - vec![ - - (NaiveDate::from_ymd_res(2004, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2004, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2004, 4, 9)?, "Велики петък"), - (NaiveDate::from_ymd_res(2004, 4, 10)?, "Велика събота"), - (NaiveDate::from_ymd_res(2004, 4, 11)?, "Великден"), - (NaiveDate::from_ymd_res(2004, 4, 12)?, "Великден"), - (NaiveDate::from_ymd_res(2004, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2004, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2004, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2004, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2004, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2004, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2004, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2004, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2004, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Велики петък"), + (NaiveDate::from_ymd_res(2004, 4, 10)?, "Велика събота"), + (NaiveDate::from_ymd_res(2004, 4, 11)?, "Великден"), + (NaiveDate::from_ymd_res(2004, 4, 12)?, "Великден"), + (NaiveDate::from_ymd_res(2004, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2004, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2004, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2004, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2004, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2004, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2004, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2004, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2005, - vec![ - - (NaiveDate::from_ymd_res(2005, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2005, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2005, 4, 29)?, "Велики петък"), - (NaiveDate::from_ymd_res(2005, 4, 30)?, "Велика събота"), - (NaiveDate::from_ymd_res(2005, 5, 1)?, "Великден; Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2005, 5, 2)?, "Великден"), - (NaiveDate::from_ymd_res(2005, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2005, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2005, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2005, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2005, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2005, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2005, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2005, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2005, 4, 29)?, "Велики петък"), + (NaiveDate::from_ymd_res(2005, 4, 30)?, "Велика събота"), + (NaiveDate::from_ymd_res(2005, 5, 1)?, "Великден; Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2005, 5, 2)?, "Великден"), + (NaiveDate::from_ymd_res(2005, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2005, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2005, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2005, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2005, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2005, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2005, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2006, - vec![ - - (NaiveDate::from_ymd_res(2006, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2006, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2006, 4, 21)?, "Велики петък"), - (NaiveDate::from_ymd_res(2006, 4, 22)?, "Велика събота"), - (NaiveDate::from_ymd_res(2006, 4, 23)?, "Великден"), - (NaiveDate::from_ymd_res(2006, 4, 24)?, "Великден"), - (NaiveDate::from_ymd_res(2006, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2006, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2006, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2006, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2006, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2006, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2006, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2006, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2006, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2006, 4, 21)?, "Велики петък"), + (NaiveDate::from_ymd_res(2006, 4, 22)?, "Велика събота"), + (NaiveDate::from_ymd_res(2006, 4, 23)?, "Великден"), + (NaiveDate::from_ymd_res(2006, 4, 24)?, "Великден"), + (NaiveDate::from_ymd_res(2006, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2006, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2006, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2006, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2006, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2006, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2006, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2006, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2007, - vec![ - - (NaiveDate::from_ymd_res(2007, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2007, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2007, 4, 6)?, "Велики петък"), - (NaiveDate::from_ymd_res(2007, 4, 7)?, "Велика събота"), - (NaiveDate::from_ymd_res(2007, 4, 8)?, "Великден"), - (NaiveDate::from_ymd_res(2007, 4, 9)?, "Великден"), - (NaiveDate::from_ymd_res(2007, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2007, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2007, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2007, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2007, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2007, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2007, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2007, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2007, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Велики петък"), + (NaiveDate::from_ymd_res(2007, 4, 7)?, "Велика събота"), + (NaiveDate::from_ymd_res(2007, 4, 8)?, "Великден"), + (NaiveDate::from_ymd_res(2007, 4, 9)?, "Великден"), + (NaiveDate::from_ymd_res(2007, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2007, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2007, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2007, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2007, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2007, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2007, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2007, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2008, - vec![ - - (NaiveDate::from_ymd_res(2008, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2008, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2008, 4, 25)?, "Велики петък"), - (NaiveDate::from_ymd_res(2008, 4, 26)?, "Велика събота"), - (NaiveDate::from_ymd_res(2008, 4, 27)?, "Великден"), - (NaiveDate::from_ymd_res(2008, 4, 28)?, "Великден"), - (NaiveDate::from_ymd_res(2008, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2008, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2008, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2008, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2008, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2008, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2008, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2008, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2008, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2008, 4, 25)?, "Велики петък"), + (NaiveDate::from_ymd_res(2008, 4, 26)?, "Велика събота"), + (NaiveDate::from_ymd_res(2008, 4, 27)?, "Великден"), + (NaiveDate::from_ymd_res(2008, 4, 28)?, "Великден"), + (NaiveDate::from_ymd_res(2008, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2008, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2008, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2008, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2008, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2008, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2008, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2008, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2009, - vec![ - - (NaiveDate::from_ymd_res(2009, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2009, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2009, 4, 17)?, "Велики петък"), - (NaiveDate::from_ymd_res(2009, 4, 18)?, "Велика събота"), - (NaiveDate::from_ymd_res(2009, 4, 19)?, "Великден"), - (NaiveDate::from_ymd_res(2009, 4, 20)?, "Великден"), - (NaiveDate::from_ymd_res(2009, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2009, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2009, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2009, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2009, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2009, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2009, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2009, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2009, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2009, 4, 17)?, "Велики петък"), + (NaiveDate::from_ymd_res(2009, 4, 18)?, "Велика събота"), + (NaiveDate::from_ymd_res(2009, 4, 19)?, "Великден"), + (NaiveDate::from_ymd_res(2009, 4, 20)?, "Великден"), + (NaiveDate::from_ymd_res(2009, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2009, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2009, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2009, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2009, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2009, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2009, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2009, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2010, - vec![ - - (NaiveDate::from_ymd_res(2010, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2010, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2010, 4, 2)?, "Велики петък"), - (NaiveDate::from_ymd_res(2010, 4, 3)?, "Велика събота"), - (NaiveDate::from_ymd_res(2010, 4, 4)?, "Великден"), - (NaiveDate::from_ymd_res(2010, 4, 5)?, "Великден"), - (NaiveDate::from_ymd_res(2010, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2010, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2010, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2010, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2010, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2010, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2010, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2010, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2010, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Велики петък"), + (NaiveDate::from_ymd_res(2010, 4, 3)?, "Велика събота"), + (NaiveDate::from_ymd_res(2010, 4, 4)?, "Великден"), + (NaiveDate::from_ymd_res(2010, 4, 5)?, "Великден"), + (NaiveDate::from_ymd_res(2010, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2010, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2010, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2010, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2010, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2010, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2010, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2010, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2011, - vec![ - - (NaiveDate::from_ymd_res(2011, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2011, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2011, 4, 22)?, "Велики петък"), - (NaiveDate::from_ymd_res(2011, 4, 23)?, "Велика събота"), - (NaiveDate::from_ymd_res(2011, 4, 24)?, "Великден"), - (NaiveDate::from_ymd_res(2011, 4, 25)?, "Великден"), - (NaiveDate::from_ymd_res(2011, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2011, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2011, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2011, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2011, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2011, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2011, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2011, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2011, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Велики петък"), + (NaiveDate::from_ymd_res(2011, 4, 23)?, "Велика събота"), + (NaiveDate::from_ymd_res(2011, 4, 24)?, "Великден"), + (NaiveDate::from_ymd_res(2011, 4, 25)?, "Великден"), + (NaiveDate::from_ymd_res(2011, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2011, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2011, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2011, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2011, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2011, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2011, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2011, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2012, - vec![ - - (NaiveDate::from_ymd_res(2012, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2012, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2012, 4, 13)?, "Велики петък"), - (NaiveDate::from_ymd_res(2012, 4, 14)?, "Велика събота"), - (NaiveDate::from_ymd_res(2012, 4, 15)?, "Великден"), - (NaiveDate::from_ymd_res(2012, 4, 16)?, "Великден"), - (NaiveDate::from_ymd_res(2012, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2012, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2012, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2012, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2012, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2012, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2012, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2012, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2012, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2012, 4, 13)?, "Велики петък"), + (NaiveDate::from_ymd_res(2012, 4, 14)?, "Велика събота"), + (NaiveDate::from_ymd_res(2012, 4, 15)?, "Великден"), + (NaiveDate::from_ymd_res(2012, 4, 16)?, "Великден"), + (NaiveDate::from_ymd_res(2012, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2012, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2012, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2012, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2012, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2012, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2012, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2012, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2013, - vec![ - - (NaiveDate::from_ymd_res(2013, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2013, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2013, 5, 3)?, "Велики петък"), - (NaiveDate::from_ymd_res(2013, 5, 4)?, "Велика събота"), - (NaiveDate::from_ymd_res(2013, 5, 5)?, "Великден"), - (NaiveDate::from_ymd_res(2013, 5, 6)?, "Великден; Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2013, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2013, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2013, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2013, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2013, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2013, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2013, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2013, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2013, 5, 3)?, "Велики петък"), + (NaiveDate::from_ymd_res(2013, 5, 4)?, "Велика събота"), + (NaiveDate::from_ymd_res(2013, 5, 5)?, "Великден"), + (NaiveDate::from_ymd_res(2013, 5, 6)?, "Великден; Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2013, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2013, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2013, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2013, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2013, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2013, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2013, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2014, - vec![ - - (NaiveDate::from_ymd_res(2014, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2014, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2014, 4, 18)?, "Велики петък"), - (NaiveDate::from_ymd_res(2014, 4, 19)?, "Велика събота"), - (NaiveDate::from_ymd_res(2014, 4, 20)?, "Великден"), - (NaiveDate::from_ymd_res(2014, 4, 21)?, "Великден"), - (NaiveDate::from_ymd_res(2014, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2014, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2014, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2014, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2014, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2014, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2014, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2014, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2014, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Велики петък"), + (NaiveDate::from_ymd_res(2014, 4, 19)?, "Велика събота"), + (NaiveDate::from_ymd_res(2014, 4, 20)?, "Великден"), + (NaiveDate::from_ymd_res(2014, 4, 21)?, "Великден"), + (NaiveDate::from_ymd_res(2014, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2014, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2014, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2014, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2014, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2014, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2014, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2014, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2015, - vec![ - - (NaiveDate::from_ymd_res(2015, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2015, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2015, 4, 10)?, "Велики петък"), - (NaiveDate::from_ymd_res(2015, 4, 11)?, "Велика събота"), - (NaiveDate::from_ymd_res(2015, 4, 12)?, "Великден"), - (NaiveDate::from_ymd_res(2015, 4, 13)?, "Великден"), - (NaiveDate::from_ymd_res(2015, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2015, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2015, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2015, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2015, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2015, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2015, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2015, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2015, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2015, 4, 10)?, "Велики петък"), + (NaiveDate::from_ymd_res(2015, 4, 11)?, "Велика събота"), + (NaiveDate::from_ymd_res(2015, 4, 12)?, "Великден"), + (NaiveDate::from_ymd_res(2015, 4, 13)?, "Великден"), + (NaiveDate::from_ymd_res(2015, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2015, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2015, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2015, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2015, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2015, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2015, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2015, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2016, - vec![ - - (NaiveDate::from_ymd_res(2016, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2016, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2016, 4, 29)?, "Велики петък"), - (NaiveDate::from_ymd_res(2016, 4, 30)?, "Велика събота"), - (NaiveDate::from_ymd_res(2016, 5, 1)?, "Великден; Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2016, 5, 2)?, "Великден"), - (NaiveDate::from_ymd_res(2016, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2016, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2016, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2016, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2016, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2016, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2016, 12, 26)?, "Рождество Христово"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2016, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2016, 4, 29)?, "Велики петък"), + (NaiveDate::from_ymd_res(2016, 4, 30)?, "Велика събота"), + (NaiveDate::from_ymd_res(2016, 5, 1)?, "Великден; Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2016, 5, 2)?, "Великден"), + (NaiveDate::from_ymd_res(2016, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2016, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2016, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2016, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2016, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2016, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2016, 12, 26)?, "Рождество Христово"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2017, - vec![ - - (NaiveDate::from_ymd_res(2017, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2017, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2017, 4, 14)?, "Велики петък"), - (NaiveDate::from_ymd_res(2017, 4, 15)?, "Велика събота"), - (NaiveDate::from_ymd_res(2017, 4, 16)?, "Великден"), - (NaiveDate::from_ymd_res(2017, 4, 17)?, "Великден"), - (NaiveDate::from_ymd_res(2017, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2017, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2017, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2017, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2017, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2017, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2017, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2017, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2017, 1, 2)?, "Нова година (почивен ден)"), - (NaiveDate::from_ymd_res(2017, 5, 8)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), - (NaiveDate::from_ymd_res(2017, 12, 27)?, "Бъдни вечер (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2017, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Велики петък"), + (NaiveDate::from_ymd_res(2017, 4, 15)?, "Велика събота"), + (NaiveDate::from_ymd_res(2017, 4, 16)?, "Великден"), + (NaiveDate::from_ymd_res(2017, 4, 17)?, "Великден"), + (NaiveDate::from_ymd_res(2017, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2017, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2017, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2017, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2017, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2017, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2017, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2017, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2017, 1, 2)?, "Нова година (почивен ден)"), + (NaiveDate::from_ymd_res(2017, 5, 8)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), + (NaiveDate::from_ymd_res(2017, 12, 27)?, "Бъдни вечер (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2018, - vec![ - - (NaiveDate::from_ymd_res(2018, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2018, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2018, 4, 6)?, "Велики петък"), - (NaiveDate::from_ymd_res(2018, 4, 7)?, "Велика събота"), - (NaiveDate::from_ymd_res(2018, 4, 8)?, "Великден"), - (NaiveDate::from_ymd_res(2018, 4, 9)?, "Великден"), - (NaiveDate::from_ymd_res(2018, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2018, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2018, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2018, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2018, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2018, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2018, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2018, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2018, 3, 5)?, "Ден на Освобождението на България от османско иго (почивен ден)"), - (NaiveDate::from_ymd_res(2018, 5, 7)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), - (NaiveDate::from_ymd_res(2018, 9, 24)?, "Ден на Независимостта на България (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2018, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2018, 4, 6)?, "Велики петък"), + (NaiveDate::from_ymd_res(2018, 4, 7)?, "Велика събота"), + (NaiveDate::from_ymd_res(2018, 4, 8)?, "Великден"), + (NaiveDate::from_ymd_res(2018, 4, 9)?, "Великден"), + (NaiveDate::from_ymd_res(2018, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2018, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2018, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2018, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2018, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2018, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2018, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2018, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2018, 3, 5)?, "Ден на Освобождението на България от османско иго (почивен ден)"), + (NaiveDate::from_ymd_res(2018, 5, 7)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), + (NaiveDate::from_ymd_res(2018, 9, 24)?, "Ден на Независимостта на България (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2019, - vec![ - - (NaiveDate::from_ymd_res(2019, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2019, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2019, 4, 26)?, "Велики петък"), - (NaiveDate::from_ymd_res(2019, 4, 27)?, "Велика събота"), - (NaiveDate::from_ymd_res(2019, 4, 28)?, "Великден"), - (NaiveDate::from_ymd_res(2019, 4, 29)?, "Великден"), - (NaiveDate::from_ymd_res(2019, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2019, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2019, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2019, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2019, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2019, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2019, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2019, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2019, 3, 4)?, "Ден на Освобождението на България от османско иго (почивен ден)"), - (NaiveDate::from_ymd_res(2019, 9, 23)?, "Ден на Независимостта на България (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2019, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2019, 4, 26)?, "Велики петък"), + (NaiveDate::from_ymd_res(2019, 4, 27)?, "Велика събота"), + (NaiveDate::from_ymd_res(2019, 4, 28)?, "Великден"), + (NaiveDate::from_ymd_res(2019, 4, 29)?, "Великден"), + (NaiveDate::from_ymd_res(2019, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2019, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2019, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2019, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2019, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2019, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2019, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2019, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2019, 3, 4)?, "Ден на Освобождението на България от османско иго (почивен ден)"), + (NaiveDate::from_ymd_res(2019, 9, 23)?, "Ден на Независимостта на България (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2020, - vec![ - - (NaiveDate::from_ymd_res(2020, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2020, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2020, 4, 17)?, "Велики петък"), - (NaiveDate::from_ymd_res(2020, 4, 18)?, "Велика събота"), - (NaiveDate::from_ymd_res(2020, 4, 19)?, "Великден"), - (NaiveDate::from_ymd_res(2020, 4, 20)?, "Великден"), - (NaiveDate::from_ymd_res(2020, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2020, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2020, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2020, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2020, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2020, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2020, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2020, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2020, 5, 25)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност (почивен ден)"), - (NaiveDate::from_ymd_res(2020, 9, 7)?, "Ден на Съединението (почивен ден)"), - (NaiveDate::from_ymd_res(2020, 12, 28)?, "Рождество Христово (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2020, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2020, 4, 17)?, "Велики петък"), + (NaiveDate::from_ymd_res(2020, 4, 18)?, "Велика събота"), + (NaiveDate::from_ymd_res(2020, 4, 19)?, "Великден"), + (NaiveDate::from_ymd_res(2020, 4, 20)?, "Великден"), + (NaiveDate::from_ymd_res(2020, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2020, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2020, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2020, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2020, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2020, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2020, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2020, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2020, 5, 25)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност (почивен ден)"), + (NaiveDate::from_ymd_res(2020, 9, 7)?, "Ден на Съединението (почивен ден)"), + (NaiveDate::from_ymd_res(2020, 12, 28)?, "Рождество Христово (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2021, - vec![ - - (NaiveDate::from_ymd_res(2021, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2021, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2021, 4, 30)?, "Велики петък"), - (NaiveDate::from_ymd_res(2021, 5, 1)?, "Велика събота; Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2021, 5, 2)?, "Великден"), - (NaiveDate::from_ymd_res(2021, 5, 3)?, "Великден"), - (NaiveDate::from_ymd_res(2021, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2021, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2021, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2021, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2021, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2021, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2021, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2021, 5, 4)?, "Ден на труда и на международната работническа солидарност (почивен ден)"), - (NaiveDate::from_ymd_res(2021, 12, 27)?, "Рождество Христово (почивен ден)"), - (NaiveDate::from_ymd_res(2021, 12, 28)?, "Рождество Христово (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2021, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2021, 4, 30)?, "Велики петък"), + (NaiveDate::from_ymd_res(2021, 5, 1)?, "Велика събота; Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2021, 5, 2)?, "Великден"), + (NaiveDate::from_ymd_res(2021, 5, 3)?, "Великден"), + (NaiveDate::from_ymd_res(2021, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2021, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2021, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2021, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2021, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2021, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2021, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2021, 5, 4)?, "Ден на труда и на международната работническа солидарност (почивен ден)"), + (NaiveDate::from_ymd_res(2021, 12, 27)?, "Рождество Христово (почивен ден)"), + (NaiveDate::from_ymd_res(2021, 12, 28)?, "Рождество Христово (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2022, - vec![ - - (NaiveDate::from_ymd_res(2022, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2022, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2022, 4, 22)?, "Велики петък"), - (NaiveDate::from_ymd_res(2022, 4, 23)?, "Велика събота"), - (NaiveDate::from_ymd_res(2022, 4, 24)?, "Великден"), - (NaiveDate::from_ymd_res(2022, 4, 25)?, "Великден"), - (NaiveDate::from_ymd_res(2022, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2022, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2022, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2022, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2022, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2022, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2022, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2022, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2022, 1, 3)?, "Нова година (почивен ден)"), - (NaiveDate::from_ymd_res(2022, 5, 2)?, "Ден на труда и на международната работническа солидарност (почивен ден)"), - (NaiveDate::from_ymd_res(2022, 12, 27)?, "Бъдни вечер (почивен ден)"), - (NaiveDate::from_ymd_res(2022, 12, 28)?, "Рождество Христово (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2022, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2022, 4, 22)?, "Велики петък"), + (NaiveDate::from_ymd_res(2022, 4, 23)?, "Велика събота"), + (NaiveDate::from_ymd_res(2022, 4, 24)?, "Великден"), + (NaiveDate::from_ymd_res(2022, 4, 25)?, "Великден"), + (NaiveDate::from_ymd_res(2022, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2022, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2022, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2022, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2022, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2022, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2022, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2022, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2022, 1, 3)?, "Нова година (почивен ден)"), + (NaiveDate::from_ymd_res(2022, 5, 2)?, "Ден на труда и на международната работническа солидарност (почивен ден)"), + (NaiveDate::from_ymd_res(2022, 12, 27)?, "Бъдни вечер (почивен ден)"), + (NaiveDate::from_ymd_res(2022, 12, 28)?, "Рождество Христово (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2023, - vec![ - - (NaiveDate::from_ymd_res(2023, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2023, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2023, 4, 14)?, "Велики петък"), - (NaiveDate::from_ymd_res(2023, 4, 15)?, "Велика събота"), - (NaiveDate::from_ymd_res(2023, 4, 16)?, "Великден"), - (NaiveDate::from_ymd_res(2023, 4, 17)?, "Великден"), - (NaiveDate::from_ymd_res(2023, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2023, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2023, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2023, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2023, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2023, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2023, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2023, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2023, 1, 2)?, "Нова година (почивен ден)"), - (NaiveDate::from_ymd_res(2023, 5, 8)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), - (NaiveDate::from_ymd_res(2023, 12, 27)?, "Бъдни вечер (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2023, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2023, 4, 14)?, "Велики петък"), + (NaiveDate::from_ymd_res(2023, 4, 15)?, "Велика събота"), + (NaiveDate::from_ymd_res(2023, 4, 16)?, "Великден"), + (NaiveDate::from_ymd_res(2023, 4, 17)?, "Великден"), + (NaiveDate::from_ymd_res(2023, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2023, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2023, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2023, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2023, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2023, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2023, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2023, 1, 2)?, "Нова година (почивен ден)"), + (NaiveDate::from_ymd_res(2023, 5, 8)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), + (NaiveDate::from_ymd_res(2023, 12, 27)?, "Бъдни вечер (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2024, - vec![ - - (NaiveDate::from_ymd_res(2024, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2024, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2024, 5, 3)?, "Велики петък"), - (NaiveDate::from_ymd_res(2024, 5, 4)?, "Велика събота"), - (NaiveDate::from_ymd_res(2024, 5, 5)?, "Великден"), - (NaiveDate::from_ymd_res(2024, 5, 6)?, "Великден; Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2024, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2024, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2024, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2024, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2024, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2024, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2024, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2024, 3, 4)?, "Ден на Освобождението на България от османско иго (почивен ден)"), - (NaiveDate::from_ymd_res(2024, 9, 23)?, "Ден на Независимостта на България (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2024, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2024, 5, 3)?, "Велики петък"), + (NaiveDate::from_ymd_res(2024, 5, 4)?, "Велика събота"), + (NaiveDate::from_ymd_res(2024, 5, 5)?, "Великден"), + (NaiveDate::from_ymd_res(2024, 5, 6)?, "Великден; Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2024, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2024, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2024, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2024, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2024, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2024, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2024, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2024, 3, 4)?, "Ден на Освобождението на България от османско иго (почивен ден)"), + (NaiveDate::from_ymd_res(2024, 9, 23)?, "Ден на Независимостта на България (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2025, - vec![ - - (NaiveDate::from_ymd_res(2025, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2025, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2025, 4, 18)?, "Велики петък"), - (NaiveDate::from_ymd_res(2025, 4, 19)?, "Велика събота"), - (NaiveDate::from_ymd_res(2025, 4, 20)?, "Великден"), - (NaiveDate::from_ymd_res(2025, 4, 21)?, "Великден"), - (NaiveDate::from_ymd_res(2025, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2025, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2025, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2025, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2025, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2025, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2025, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2025, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2025, 5, 26)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност (почивен ден)"), - (NaiveDate::from_ymd_res(2025, 9, 8)?, "Ден на Съединението (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2025, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Велики петък"), + (NaiveDate::from_ymd_res(2025, 4, 19)?, "Велика събота"), + (NaiveDate::from_ymd_res(2025, 4, 20)?, "Великден"), + (NaiveDate::from_ymd_res(2025, 4, 21)?, "Великден"), + (NaiveDate::from_ymd_res(2025, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2025, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2025, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2025, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2025, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2025, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2025, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2025, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2025, 5, 26)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност (почивен ден)"), + (NaiveDate::from_ymd_res(2025, 9, 8)?, "Ден на Съединението (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2026, - vec![ - - (NaiveDate::from_ymd_res(2026, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2026, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2026, 4, 10)?, "Велики петък"), - (NaiveDate::from_ymd_res(2026, 4, 11)?, "Велика събота"), - (NaiveDate::from_ymd_res(2026, 4, 12)?, "Великден"), - (NaiveDate::from_ymd_res(2026, 4, 13)?, "Великден"), - (NaiveDate::from_ymd_res(2026, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2026, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2026, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2026, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2026, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2026, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2026, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2026, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2026, 5, 25)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност (почивен ден)"), - (NaiveDate::from_ymd_res(2026, 9, 7)?, "Ден на Съединението (почивен ден)"), - (NaiveDate::from_ymd_res(2026, 12, 28)?, "Рождество Христово (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2026, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2026, 4, 10)?, "Велики петък"), + (NaiveDate::from_ymd_res(2026, 4, 11)?, "Велика събота"), + (NaiveDate::from_ymd_res(2026, 4, 12)?, "Великден"), + (NaiveDate::from_ymd_res(2026, 4, 13)?, "Великден"), + (NaiveDate::from_ymd_res(2026, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2026, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2026, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2026, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2026, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2026, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2026, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2026, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2026, 5, 25)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност (почивен ден)"), + (NaiveDate::from_ymd_res(2026, 9, 7)?, "Ден на Съединението (почивен ден)"), + (NaiveDate::from_ymd_res(2026, 12, 28)?, "Рождество Христово (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2027, - vec![ - - (NaiveDate::from_ymd_res(2027, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2027, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2027, 4, 30)?, "Велики петък"), - (NaiveDate::from_ymd_res(2027, 5, 1)?, "Велика събота; Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2027, 5, 2)?, "Великден"), - (NaiveDate::from_ymd_res(2027, 5, 3)?, "Великден"), - (NaiveDate::from_ymd_res(2027, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2027, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2027, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2027, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2027, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2027, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2027, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2027, 5, 4)?, "Ден на труда и на международната работническа солидарност (почивен ден)"), - (NaiveDate::from_ymd_res(2027, 12, 27)?, "Рождество Христово (почивен ден)"), - (NaiveDate::from_ymd_res(2027, 12, 28)?, "Рождество Христово (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2027, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2027, 4, 30)?, "Велики петък"), + (NaiveDate::from_ymd_res(2027, 5, 1)?, "Велика събота; Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2027, 5, 2)?, "Великден"), + (NaiveDate::from_ymd_res(2027, 5, 3)?, "Великден"), + (NaiveDate::from_ymd_res(2027, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2027, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2027, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2027, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2027, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2027, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2027, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2027, 5, 4)?, "Ден на труда и на международната работническа солидарност (почивен ден)"), + (NaiveDate::from_ymd_res(2027, 12, 27)?, "Рождество Христово (почивен ден)"), + (NaiveDate::from_ymd_res(2027, 12, 28)?, "Рождество Христово (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2028, - vec![ - - (NaiveDate::from_ymd_res(2028, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2028, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2028, 4, 14)?, "Велики петък"), - (NaiveDate::from_ymd_res(2028, 4, 15)?, "Велика събота"), - (NaiveDate::from_ymd_res(2028, 4, 16)?, "Великден"), - (NaiveDate::from_ymd_res(2028, 4, 17)?, "Великден"), - (NaiveDate::from_ymd_res(2028, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2028, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2028, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2028, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2028, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2028, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2028, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2028, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2028, 1, 3)?, "Нова година (почивен ден)"), - (NaiveDate::from_ymd_res(2028, 5, 8)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), - (NaiveDate::from_ymd_res(2028, 12, 27)?, "Бъдни вечер (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2028, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Велики петък"), + (NaiveDate::from_ymd_res(2028, 4, 15)?, "Велика събота"), + (NaiveDate::from_ymd_res(2028, 4, 16)?, "Великден"), + (NaiveDate::from_ymd_res(2028, 4, 17)?, "Великден"), + (NaiveDate::from_ymd_res(2028, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2028, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2028, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2028, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2028, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2028, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2028, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2028, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2028, 1, 3)?, "Нова година (почивен ден)"), + (NaiveDate::from_ymd_res(2028, 5, 8)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), + (NaiveDate::from_ymd_res(2028, 12, 27)?, "Бъдни вечер (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2029, - vec![ - - (NaiveDate::from_ymd_res(2029, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2029, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2029, 4, 6)?, "Велики петък"), - (NaiveDate::from_ymd_res(2029, 4, 7)?, "Велика събота"), - (NaiveDate::from_ymd_res(2029, 4, 8)?, "Великден"), - (NaiveDate::from_ymd_res(2029, 4, 9)?, "Великден"), - (NaiveDate::from_ymd_res(2029, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2029, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2029, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2029, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2029, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2029, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2029, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2029, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2029, 3, 5)?, "Ден на Освобождението на България от османско иго (почивен ден)"), - (NaiveDate::from_ymd_res(2029, 5, 7)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), - (NaiveDate::from_ymd_res(2029, 9, 24)?, "Ден на Независимостта на България (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2029, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2029, 4, 6)?, "Велики петък"), + (NaiveDate::from_ymd_res(2029, 4, 7)?, "Велика събота"), + (NaiveDate::from_ymd_res(2029, 4, 8)?, "Великден"), + (NaiveDate::from_ymd_res(2029, 4, 9)?, "Великден"), + (NaiveDate::from_ymd_res(2029, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2029, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2029, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2029, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2029, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2029, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2029, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2029, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2029, 3, 5)?, "Ден на Освобождението на България от османско иго (почивен ден)"), + (NaiveDate::from_ymd_res(2029, 5, 7)?, "Гергьовден, Ден на храбростта и Българската армия (почивен ден)"), + (NaiveDate::from_ymd_res(2029, 9, 24)?, "Ден на Независимостта на България (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2030, - vec![ - - (NaiveDate::from_ymd_res(2030, 1, 1)?, "Нова година"), - (NaiveDate::from_ymd_res(2030, 3, 3)?, "Ден на Освобождението на България от османско иго"), - (NaiveDate::from_ymd_res(2030, 4, 26)?, "Велики петък"), - (NaiveDate::from_ymd_res(2030, 4, 27)?, "Велика събота"), - (NaiveDate::from_ymd_res(2030, 4, 28)?, "Великден"), - (NaiveDate::from_ymd_res(2030, 4, 29)?, "Великден"), - (NaiveDate::from_ymd_res(2030, 5, 1)?, "Ден на труда и на международната работническа солидарност"), - (NaiveDate::from_ymd_res(2030, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), - (NaiveDate::from_ymd_res(2030, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), - (NaiveDate::from_ymd_res(2030, 9, 6)?, "Ден на Съединението"), - (NaiveDate::from_ymd_res(2030, 9, 22)?, "Ден на Независимостта на България"), - (NaiveDate::from_ymd_res(2030, 12, 24)?, "Бъдни вечер"), - (NaiveDate::from_ymd_res(2030, 12, 25)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2030, 12, 26)?, "Рождество Христово"), - (NaiveDate::from_ymd_res(2030, 3, 4)?, "Ден на Освобождението на България от османско иго (почивен ден)"), - (NaiveDate::from_ymd_res(2030, 9, 23)?, "Ден на Независимостта на България (почивен ден)"), - ], - &mut map, - Country::BG, - "Bulgaria", - ); + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 1)?, "Нова година"), + (NaiveDate::from_ymd_res(2030, 3, 3)?, "Ден на Освобождението на България от османско иго"), + (NaiveDate::from_ymd_res(2030, 4, 26)?, "Велики петък"), + (NaiveDate::from_ymd_res(2030, 4, 27)?, "Велика събота"), + (NaiveDate::from_ymd_res(2030, 4, 28)?, "Великден"), + (NaiveDate::from_ymd_res(2030, 4, 29)?, "Великден"), + (NaiveDate::from_ymd_res(2030, 5, 1)?, "Ден на труда и на международната работническа солидарност"), + (NaiveDate::from_ymd_res(2030, 5, 6)?, "Гергьовден, Ден на храбростта и Българската армия"), + (NaiveDate::from_ymd_res(2030, 5, 24)?, "Ден на светите братя Кирил и Методий, на българската азбука, просвета и култура и на славянската книжовност"), + (NaiveDate::from_ymd_res(2030, 9, 6)?, "Ден на Съединението"), + (NaiveDate::from_ymd_res(2030, 9, 22)?, "Ден на Независимостта на България"), + (NaiveDate::from_ymd_res(2030, 12, 24)?, "Бъдни вечер"), + (NaiveDate::from_ymd_res(2030, 12, 25)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2030, 12, 26)?, "Рождество Христово"), + (NaiveDate::from_ymd_res(2030, 3, 4)?, "Ден на Освобождението на България от османско иго (почивен ден)"), + (NaiveDate::from_ymd_res(2030, 9, 23)?, "Ден на Независимостта на България (почивен ден)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); Ok(map) } diff --git a/src/data/bi.rs b/src/data/bi.rs index 026d0a1..9f52112 100644 --- a/src/data/bi.rs +++ b/src/data/bi.rs @@ -1,17 +1,24 @@ //! Burundi +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Burundi"; +const COUNTY_CODE: Country = Country::BI; + /// Generate holiday map for Burundi. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 2, 5)?, "Unity Day"), ( @@ -46,14 +53,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 2, 5)?, "Unity Day"), ( @@ -96,14 +103,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 2, 5)?, "Unity Day"), ( @@ -138,14 +145,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 2, 5)?, "Unity Day"), ( @@ -180,14 +187,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 2, 5)?, "Unity Day"), ( @@ -230,14 +237,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 2, 5)?, "Unity Day"), ( @@ -276,14 +283,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -323,14 +330,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 2, 5)?, "Unity Day"), ( @@ -365,14 +372,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 2, 5)?, "Unity Day"), ( @@ -409,14 +416,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 2, 5)?, "Unity Day"), ( @@ -455,14 +462,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 2, 5)?, "Unity Day"), ( @@ -497,14 +504,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 2, 5)?, "Unity Day"), ( @@ -547,14 +554,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -602,14 +609,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 2, 5)?, "Unity Day"), ( @@ -644,14 +651,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 2, 5)?, "Unity Day"), ( @@ -686,14 +693,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 2, 5)?, "Unity Day"), ( @@ -728,14 +735,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 2, 5)?, "Unity Day"), ( @@ -778,14 +785,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -825,14 +832,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 2, 5)?, "Unity Day"), ( @@ -871,14 +878,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 2, 5)?, "Unity Day"), ( @@ -917,14 +924,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 2, 5)?, "Unity Day"), ( @@ -963,14 +970,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 2, 5)?, "Unity Day"), ( @@ -1004,14 +1011,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 2, 5)?, "Unity Day"), ( @@ -1050,14 +1057,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -1097,14 +1104,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 2, 5)?, "Unity Day"), ( @@ -1147,14 +1154,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 2, 5)?, "Unity Day"), ( @@ -1201,14 +1208,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 2, 5)?, "Unity Day"), ( @@ -1247,14 +1254,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 2, 5)?, "Unity Day"), ( @@ -1297,14 +1304,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 2, 5)?, "Unity Day"), ( @@ -1339,14 +1346,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 2, 5)?, "Unity Day"), ( @@ -1389,14 +1396,14 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 2, 5)?, "Unity Day"), ( @@ -1435,8 +1442,8 @@ pub fn build( ), ], &mut map, - Country::BI, - "Burundi", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/bo.rs b/src/data/bo.rs index 3b35487..4ef0feb 100644 --- a/src/data/bo.rs +++ b/src/data/bo.rs @@ -1,17 +1,24 @@ //! Bolivia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Bolivia"; +const COUNTY_CODE: Country = Country::BO; + /// Generate holiday map for Bolivia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2000, 3, 6)?, "Carnaval"), (NaiveDate::from_ymd_res(2000, 3, 7)?, "Carnaval"), @@ -33,14 +40,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2001, 2, 26)?, "Carnaval"), (NaiveDate::from_ymd_res(2001, 2, 27)?, "Carnaval"), @@ -58,14 +65,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2002, 2, 11)?, "Carnaval"), (NaiveDate::from_ymd_res(2002, 2, 12)?, "Carnaval"), @@ -83,14 +90,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2003, 3, 3)?, "Carnaval"), (NaiveDate::from_ymd_res(2003, 3, 4)?, "Carnaval"), @@ -112,14 +119,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2004, 2, 23)?, "Carnaval"), (NaiveDate::from_ymd_res(2004, 2, 24)?, "Carnaval"), @@ -137,14 +144,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2005, 2, 7)?, "Carnaval"), (NaiveDate::from_ymd_res(2005, 2, 8)?, "Carnaval"), @@ -170,14 +177,14 @@ pub fn build( ), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -203,14 +210,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2007, 2, 19)?, "Carnaval"), (NaiveDate::from_ymd_res(2007, 2, 20)?, "Carnaval"), @@ -228,14 +235,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2008, 2, 4)?, "Carnaval"), (NaiveDate::from_ymd_res(2008, 2, 5)?, "Carnaval"), @@ -257,14 +264,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2009, 2, 23)?, "Carnaval"), (NaiveDate::from_ymd_res(2009, 2, 24)?, "Carnaval"), @@ -290,14 +297,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2010, 1, 22)?, @@ -323,14 +330,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2011, 1, 22)?, @@ -364,14 +371,14 @@ pub fn build( ), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -409,14 +416,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2013, 1, 22)?, @@ -442,14 +449,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2014, 1, 22)?, @@ -483,14 +490,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2015, 1, 22)?, @@ -520,14 +527,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2016, 1, 22)?, @@ -561,14 +568,14 @@ pub fn build( ), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -606,14 +613,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2018, 1, 22)?, @@ -639,14 +646,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2019, 1, 22)?, @@ -672,14 +679,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2020, 1, 22)?, @@ -713,14 +720,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2021, 1, 22)?, @@ -750,14 +757,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2022, 1, 22)?, @@ -795,14 +802,14 @@ pub fn build( ), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -844,14 +851,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2024, 1, 22)?, @@ -881,14 +888,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2025, 1, 22)?, @@ -918,14 +925,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2026, 1, 22)?, @@ -959,14 +966,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2027, 1, 22)?, @@ -996,14 +1003,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2028, 1, 22)?, @@ -1037,14 +1044,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2029, 1, 22)?, @@ -1074,14 +1081,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2030, 1, 22)?, @@ -1111,8 +1118,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Navidad"), ], &mut map, - Country::BO, - "Bolivia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/br.rs b/src/data/br.rs index 2a03bae..bf761cf 100644 --- a/src/data/br.rs +++ b/src/data/br.rs @@ -1,17 +1,24 @@ //! Brazil +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Brazil"; +const COUNTY_CODE: Country = Country::BR; + /// Generate holiday map for Brazil. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 1)?, "Confraternização Universal", @@ -37,14 +44,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 1)?, "Confraternização Universal", @@ -68,14 +75,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 1)?, "Confraternização Universal", @@ -99,14 +106,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 1)?, "Confraternização Universal", @@ -130,14 +137,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 1)?, "Confraternização Universal", @@ -161,14 +168,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 1)?, "Confraternização Universal", @@ -192,14 +199,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 1)?, "Confraternização Universal", @@ -223,14 +230,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Confraternização Universal", @@ -254,14 +261,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 1)?, "Confraternização Universal", @@ -285,14 +292,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 1)?, "Confraternização Universal", @@ -316,14 +323,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 1)?, "Confraternização Universal", @@ -347,14 +354,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 1)?, "Confraternização Universal", @@ -378,14 +385,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 1)?, "Confraternização Universal", @@ -409,14 +416,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 1)?, "Confraternização Universal", @@ -440,14 +447,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 1)?, "Confraternização Universal", @@ -471,14 +478,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 1, 1)?, "Confraternização Universal", @@ -502,14 +509,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 1)?, "Confraternização Universal", @@ -533,14 +540,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 1)?, "Confraternização Universal", @@ -564,14 +571,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 1)?, "Confraternização Universal", @@ -595,14 +602,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 1)?, "Confraternização Universal", @@ -626,14 +633,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 1)?, "Confraternização Universal", @@ -657,14 +664,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 1)?, "Confraternização Universal", @@ -688,14 +695,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 1)?, "Confraternização Universal", @@ -719,14 +726,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 1)?, "Confraternização Universal", @@ -750,14 +757,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 1)?, "Confraternização Universal", @@ -781,14 +788,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 1)?, "Confraternização Universal", @@ -812,14 +819,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 1)?, "Confraternização Universal", @@ -843,14 +850,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 1)?, "Confraternização Universal", @@ -874,14 +881,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 1)?, "Confraternização Universal", @@ -905,14 +912,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 1)?, "Confraternização Universal", @@ -936,14 +943,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 1)?, "Confraternização Universal", @@ -967,8 +974,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Natal"), ], &mut map, - Country::BR, - "Brazil", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/bw.rs b/src/data/bw.rs index 7358f8d..afb1cd1 100644 --- a/src/data/bw.rs +++ b/src/data/bw.rs @@ -1,17 +1,24 @@ //! Botswana +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Botswana"; +const COUNTY_CODE: Country = Country::BW; + /// Generate holiday map for Botswana. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2000, 1, 2)?, @@ -48,14 +55,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2001, 1, 2)?, @@ -92,14 +99,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2002, 1, 2)?, @@ -128,14 +135,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2003, 1, 2)?, @@ -164,14 +171,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2004, 1, 2)?, @@ -204,14 +211,14 @@ pub fn build( ), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2005, 1, 2)?, @@ -252,14 +259,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 3)?, @@ -296,14 +303,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2007, 1, 2)?, @@ -340,14 +347,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2008, 1, 2)?, @@ -378,14 +385,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2009, 1, 2)?, @@ -414,14 +421,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2010, 1, 2)?, @@ -454,14 +461,14 @@ pub fn build( ), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2011, 1, 2)?, @@ -502,14 +509,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 3)?, @@ -550,14 +557,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2013, 1, 2)?, @@ -586,14 +593,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2014, 1, 2)?, @@ -622,14 +629,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2015, 1, 2)?, @@ -658,14 +665,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2016, 1, 2)?, @@ -702,14 +709,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 3)?, @@ -746,14 +753,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2018, 1, 2)?, @@ -790,14 +797,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2019, 1, 2)?, @@ -827,14 +834,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 7, 2)?, "Public Holiday"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2020, 1, 2)?, @@ -864,14 +871,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 28)?, "Boxing Day Holiday"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2021, 1, 2)?, @@ -905,14 +912,14 @@ pub fn build( ), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2022, 1, 2)?, @@ -953,14 +960,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 3)?, @@ -997,14 +1004,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2024, 1, 2)?, @@ -1033,14 +1040,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2025, 1, 2)?, @@ -1069,14 +1076,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2026, 1, 2)?, @@ -1106,14 +1113,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 28)?, "Boxing Day Holiday"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2027, 1, 2)?, @@ -1147,14 +1154,14 @@ pub fn build( ), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 1, 2)?, @@ -1191,14 +1198,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2029, 1, 2)?, @@ -1235,14 +1242,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2030, 1, 2)?, @@ -1271,8 +1278,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::BW, - "Botswana", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/by.rs b/src/data/by.rs index 7b211a8..ca6a767 100644 --- a/src/data/by.rs +++ b/src/data/by.rs @@ -1,17 +1,24 @@ //! Belarus +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Belarus"; +const COUNTY_CODE: Country = Country::BY; + /// Generate holiday map for Belarus. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2000, 1, 7)?, @@ -45,14 +52,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2001, 1, 7)?, @@ -104,14 +111,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2002, 1, 7)?, @@ -147,14 +154,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2003, 1, 7)?, @@ -186,14 +193,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2004, 1, 7)?, @@ -233,14 +240,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2005, 1, 7)?, @@ -268,14 +275,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2006, 1, 7)?, @@ -311,14 +318,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2007, 1, 7)?, @@ -370,14 +377,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2008, 1, 7)?, @@ -417,14 +424,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2009, 1, 7)?, @@ -456,14 +463,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2010, 1, 7)?, @@ -499,14 +506,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2011, 1, 7)?, @@ -538,14 +545,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2012, 1, 7)?, @@ -589,14 +596,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2013, 1, 7)?, @@ -628,14 +635,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2014, 1, 7)?, @@ -679,14 +686,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2015, 1, 7)?, @@ -718,14 +725,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2016, 1, 7)?, @@ -757,14 +764,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2017, 1, 7)?, @@ -804,14 +811,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2018, 1, 7)?, @@ -863,14 +870,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Новы год"), ( NaiveDate::from_ymd_res(2019, 1, 7)?, @@ -906,14 +913,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "Новы год"), ( @@ -946,14 +953,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "Новы год"), ( @@ -986,14 +993,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "Новы год"), ( @@ -1026,14 +1033,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "Новы год"), ( @@ -1070,14 +1077,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "Новы год"), ( @@ -1102,14 +1109,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "Новы год"), ( @@ -1134,14 +1141,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "Новы год"), ( @@ -1166,14 +1173,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "Новы год"), ( @@ -1198,14 +1205,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "Новы год"), ( @@ -1230,14 +1237,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "Новы год"), ( @@ -1262,14 +1269,14 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Новы год"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "Новы год"), ( @@ -1294,8 +1301,8 @@ pub fn build( ), ], &mut map, - Country::BY, - "Belarus", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ca.rs b/src/data/ca.rs index fc429ab..1e7aed5 100644 --- a/src/data/ca.rs +++ b/src/data/ca.rs @@ -1,17 +1,24 @@ //! Canada +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Canada"; +const COUNTY_CODE: Country = Country::CA; + /// Generate holiday map for Canada. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2000, 1, 3)?, @@ -23,14 +30,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 7, 1)?, "Canada Day"), @@ -38,14 +45,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 7, 1)?, "Canada Day"), @@ -53,14 +60,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 7, 1)?, "Canada Day"), @@ -68,14 +75,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 7, 1)?, "Canada Day"), @@ -87,14 +94,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2005, 1, 3)?, @@ -110,14 +117,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -129,14 +136,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 7, 1)?, "Canada Day"), @@ -144,14 +151,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 7, 1)?, "Canada Day"), @@ -159,14 +166,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 7, 1)?, "Canada Day"), @@ -174,14 +181,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 7, 1)?, "Canada Day"), @@ -193,14 +200,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2011, 1, 3)?, @@ -216,14 +223,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -235,14 +242,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 7, 1)?, "Canada Day"), @@ -250,14 +257,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 7, 1)?, "Canada Day"), @@ -265,14 +272,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 7, 1)?, "Canada Day"), @@ -280,14 +287,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 7, 1)?, "Canada Day"), @@ -299,14 +306,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -318,14 +325,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 7, 1)?, "Canada Day"), @@ -333,14 +340,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2019, 7, 1)?, "Canada Day"), @@ -348,14 +355,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 7, 1)?, "Canada Day"), @@ -363,14 +370,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 7, 1)?, "Canada Day"), @@ -382,14 +389,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2022, 1, 3)?, @@ -405,14 +412,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -424,14 +431,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 7, 1)?, "Canada Day"), @@ -439,14 +446,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 7, 1)?, "Canada Day"), @@ -454,14 +461,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 7, 1)?, "Canada Day"), @@ -469,14 +476,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 7, 1)?, "Canada Day"), @@ -488,14 +495,14 @@ pub fn build( ), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 1, 3)?, @@ -507,14 +514,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 7, 1)?, "Canada Day"), @@ -522,14 +529,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2030, 7, 1)?, "Canada Day"), @@ -537,8 +544,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Christmas Day"), ], &mut map, - Country::CA, - "Canada", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ch.rs b/src/data/ch.rs index eea9fb0..ea411f3 100644 --- a/src/data/ch.rs +++ b/src/data/ch.rs @@ -1,445 +1,452 @@ //! Switzerland +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Switzerland"; +const COUNTY_CODE: Country = Country::CH; + /// Generate holiday map for Switzerland. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2000, 6, 1)?, "Auffahrt"), (NaiveDate::from_ymd_res(2000, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2000, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2001, 5, 24)?, "Auffahrt"), (NaiveDate::from_ymd_res(2001, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2001, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2002, 5, 9)?, "Auffahrt"), (NaiveDate::from_ymd_res(2002, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2002, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2003, 5, 29)?, "Auffahrt"), (NaiveDate::from_ymd_res(2003, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2003, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2004, 5, 20)?, "Auffahrt"), (NaiveDate::from_ymd_res(2004, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2004, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2005, 5, 5)?, "Auffahrt"), (NaiveDate::from_ymd_res(2005, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2005, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2006, 5, 25)?, "Auffahrt"), (NaiveDate::from_ymd_res(2006, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2006, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2007, 5, 17)?, "Auffahrt"), (NaiveDate::from_ymd_res(2007, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2007, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2008, 5, 1)?, "Auffahrt"), (NaiveDate::from_ymd_res(2008, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2008, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2009, 5, 21)?, "Auffahrt"), (NaiveDate::from_ymd_res(2009, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2009, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2010, 5, 13)?, "Auffahrt"), (NaiveDate::from_ymd_res(2010, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2010, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2011, 6, 2)?, "Auffahrt"), (NaiveDate::from_ymd_res(2011, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2011, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2012, 5, 17)?, "Auffahrt"), (NaiveDate::from_ymd_res(2012, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2012, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2013, 5, 9)?, "Auffahrt"), (NaiveDate::from_ymd_res(2013, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2013, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2014, 5, 29)?, "Auffahrt"), (NaiveDate::from_ymd_res(2014, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2014, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2015, 5, 14)?, "Auffahrt"), (NaiveDate::from_ymd_res(2015, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2015, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2016, 5, 5)?, "Auffahrt"), (NaiveDate::from_ymd_res(2016, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2016, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2017, 5, 25)?, "Auffahrt"), (NaiveDate::from_ymd_res(2017, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2017, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2018, 5, 10)?, "Auffahrt"), (NaiveDate::from_ymd_res(2018, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2018, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2019, 5, 30)?, "Auffahrt"), (NaiveDate::from_ymd_res(2019, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2019, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2020, 5, 21)?, "Auffahrt"), (NaiveDate::from_ymd_res(2020, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2020, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2021, 5, 13)?, "Auffahrt"), (NaiveDate::from_ymd_res(2021, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2021, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2022, 5, 26)?, "Auffahrt"), (NaiveDate::from_ymd_res(2022, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2022, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2023, 5, 18)?, "Auffahrt"), (NaiveDate::from_ymd_res(2023, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2023, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2024, 5, 9)?, "Auffahrt"), (NaiveDate::from_ymd_res(2024, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2024, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2025, 5, 29)?, "Auffahrt"), (NaiveDate::from_ymd_res(2025, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2025, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2026, 5, 14)?, "Auffahrt"), (NaiveDate::from_ymd_res(2026, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2026, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2027, 5, 6)?, "Auffahrt"), (NaiveDate::from_ymd_res(2027, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2027, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2028, 5, 25)?, "Auffahrt"), (NaiveDate::from_ymd_res(2028, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2028, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2029, 5, 10)?, "Auffahrt"), (NaiveDate::from_ymd_res(2029, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2029, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Neujahrestag"), (NaiveDate::from_ymd_res(2030, 5, 30)?, "Auffahrt"), (NaiveDate::from_ymd_res(2030, 8, 1)?, "Nationalfeiertag"), (NaiveDate::from_ymd_res(2030, 12, 25)?, "Weihnachten"), ], &mut map, - Country::CH, - "Switzerland", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/cl.rs b/src/data/cl.rs index 4ea7b0b..43ca56d 100644 --- a/src/data/cl.rs +++ b/src/data/cl.rs @@ -1,17 +1,24 @@ //! Chile +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Chile"; +const COUNTY_CODE: Country = Country::CL; + /// Generate holiday map for Chile. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2000, 4, 22)?, "Sábado Santo"), @@ -59,14 +66,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2001, 4, 14)?, "Sábado Santo"), @@ -114,14 +121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2002, 3, 30)?, "Sábado Santo"), @@ -165,14 +172,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2003, 4, 19)?, "Sábado Santo"), @@ -216,14 +223,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2004, 4, 10)?, "Sábado Santo"), @@ -267,14 +274,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2005, 3, 26)?, "Sábado Santo"), @@ -318,14 +325,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2006, 4, 15)?, "Sábado Santo"), @@ -369,14 +376,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2007, 4, 7)?, "Sábado Santo"), @@ -421,14 +428,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2008, 3, 22)?, "Sábado Santo"), @@ -476,14 +483,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2009, 4, 11)?, "Sábado Santo"), @@ -531,14 +538,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2010, 4, 3)?, "Sábado Santo"), @@ -586,14 +593,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2011, 4, 23)?, "Sábado Santo"), @@ -641,14 +648,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2012, 4, 7)?, "Sábado Santo"), @@ -697,14 +704,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2013, 3, 30)?, "Sábado Santo"), @@ -753,14 +760,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2014, 4, 19)?, "Sábado Santo"), @@ -808,14 +815,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2015, 4, 4)?, "Sábado Santo"), @@ -863,14 +870,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2016, 3, 26)?, "Sábado Santo"), @@ -918,14 +925,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "Feriado nacional"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Viernes Santo"), @@ -974,14 +981,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2018, 3, 31)?, "Sábado Santo"), @@ -1030,14 +1037,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2019, 4, 20)?, "Sábado Santo"), @@ -1086,14 +1093,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2020, 4, 11)?, "Sábado Santo"), @@ -1141,14 +1148,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2021, 4, 3)?, "Sábado Santo"), @@ -1201,14 +1208,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2022, 4, 16)?, "Sábado Santo"), @@ -1261,14 +1268,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 9, 16)?, "Feriado nacional"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "Feriado nacional"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Viernes Santo"), @@ -1321,14 +1328,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2024, 3, 30)?, "Sábado Santo"), @@ -1381,14 +1388,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2025, 4, 19)?, "Sábado Santo"), @@ -1440,14 +1447,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2026, 4, 4)?, "Sábado Santo"), @@ -1499,14 +1506,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2027, 3, 27)?, "Sábado Santo"), @@ -1559,14 +1566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2028, 4, 15)?, "Sábado Santo"), @@ -1618,14 +1625,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2029, 3, 31)?, "Sábado Santo"), @@ -1678,14 +1685,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2030, 4, 20)?, "Sábado Santo"), @@ -1738,8 +1745,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Navidad"), ], &mut map, - Country::CL, - "Chile", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/cn.rs b/src/data/cn.rs index c155583..efb8c28 100644 --- a/src/data/cn.rs +++ b/src/data/cn.rs @@ -1,17 +1,24 @@ //! China +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "China"; +const COUNTY_CODE: Country = Country::CN; + /// Generate holiday map for China. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2000, 2, 5)?, "春节"), (NaiveDate::from_ymd_res(2000, 2, 6)?, "春节"), @@ -28,14 +35,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 10, 4)?, "国庆节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2001, 1, 24)?, "春节"), (NaiveDate::from_ymd_res(2001, 1, 25)?, "春节"), @@ -72,14 +79,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2002, 2, 12)?, "春节"), (NaiveDate::from_ymd_res(2002, 2, 13)?, "春节"), @@ -124,14 +131,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2003, 2, 1)?, "春节"), (NaiveDate::from_ymd_res(2003, 2, 2)?, "春节"), @@ -171,14 +178,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2004, 1, 22)?, "春节"), (NaiveDate::from_ymd_res(2004, 1, 23)?, "春节"), @@ -220,14 +227,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2005, 2, 9)?, "春节"), (NaiveDate::from_ymd_res(2005, 2, 10)?, "春节"), @@ -268,14 +275,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2006, 1, 29)?, "春节"), (NaiveDate::from_ymd_res(2006, 1, 30)?, "春节"), @@ -319,14 +326,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2007, 2, 18)?, "春节"), (NaiveDate::from_ymd_res(2007, 2, 19)?, "春节"), @@ -376,14 +383,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2008, 2, 7)?, "春节"), (NaiveDate::from_ymd_res(2008, 2, 8)?, "春节"), @@ -419,14 +426,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2009, 1, 26)?, "春节"), (NaiveDate::from_ymd_res(2009, 1, 27)?, "春节"), @@ -467,14 +474,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2010, 2, 14)?, "春节"), (NaiveDate::from_ymd_res(2010, 2, 15)?, "春节"), @@ -525,14 +532,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2011, 2, 3)?, "春节"), (NaiveDate::from_ymd_res(2011, 2, 4)?, "春节"), @@ -570,14 +577,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2012, 1, 23)?, "春节"), (NaiveDate::from_ymd_res(2012, 1, 24)?, "春节"), @@ -623,14 +630,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 6, 22)?, "端午节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2013, 2, 10)?, "春节"), (NaiveDate::from_ymd_res(2013, 2, 11)?, "春节"), @@ -694,14 +701,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2014, 1, 31)?, "春节"), (NaiveDate::from_ymd_res(2014, 2, 1)?, "春节"), @@ -738,14 +745,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2015, 2, 19)?, "春节"), (NaiveDate::from_ymd_res(2015, 2, 20)?, "春节"), @@ -788,14 +795,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 10, 6)?, "中秋节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "春节"), (NaiveDate::from_ymd_res(2016, 2, 9)?, "春节"), @@ -836,14 +843,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2017, 1, 28)?, "春节"), (NaiveDate::from_ymd_res(2017, 1, 29)?, "春节"), @@ -881,14 +888,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2018, 2, 16)?, "春节"), (NaiveDate::from_ymd_res(2018, 2, 17)?, "春节"), @@ -932,14 +939,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2019, 2, 5)?, "春节"), (NaiveDate::from_ymd_res(2019, 2, 6)?, "春节"), @@ -969,14 +976,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2020, 1, 25)?, "春节"), (NaiveDate::from_ymd_res(2020, 1, 26)?, "春节"), @@ -1022,14 +1029,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 10, 6)?, "中秋节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2021, 2, 12)?, "春节"), (NaiveDate::from_ymd_res(2021, 2, 13)?, "春节"), @@ -1077,14 +1084,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2022, 2, 1)?, "春节"), (NaiveDate::from_ymd_res(2022, 2, 2)?, "春节"), @@ -1131,14 +1138,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2023, 1, 22)?, "春节"), (NaiveDate::from_ymd_res(2023, 1, 23)?, "春节"), @@ -1183,14 +1190,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2024, 2, 10)?, "春节"), (NaiveDate::from_ymd_res(2024, 2, 11)?, "春节"), @@ -1238,14 +1245,14 @@ pub fn build( ), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2025, 1, 29)?, "春节"), (NaiveDate::from_ymd_res(2025, 1, 30)?, "春节"), @@ -1260,14 +1267,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 6, 2)?, "端午节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2026, 2, 17)?, "春节"), (NaiveDate::from_ymd_res(2026, 2, 18)?, "春节"), @@ -1283,14 +1290,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 10, 5)?, "国庆节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2027, 2, 6)?, "春节"), (NaiveDate::from_ymd_res(2027, 2, 7)?, "春节"), @@ -1309,14 +1316,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 10, 5)?, "国庆节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2028, 1, 26)?, "春节"), (NaiveDate::from_ymd_res(2028, 1, 27)?, "春节"), @@ -1332,14 +1339,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 10, 4)?, "国庆节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2029, 2, 13)?, "春节"), (NaiveDate::from_ymd_res(2029, 2, 14)?, "春节"), @@ -1355,14 +1362,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 9, 24)?, "中秋节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "元旦"), (NaiveDate::from_ymd_res(2030, 2, 3)?, "春节"), (NaiveDate::from_ymd_res(2030, 2, 4)?, "春节"), @@ -1377,8 +1384,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 2, 6)?, "春节(观察日)"), ], &mut map, - Country::CN, - "China", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/co.rs b/src/data/co.rs index e5416cd..8eaaaf4 100644 --- a/src/data/co.rs +++ b/src/data/co.rs @@ -1,17 +1,24 @@ //! Colombia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Colombia"; +const COUNTY_CODE: Country = Country::CO; + /// Generate holiday map for Colombia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2000, 1, 10)?, @@ -64,14 +71,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2001, 1, 8)?, @@ -125,14 +132,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2002, 1, 7)?, @@ -189,14 +196,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2003, 1, 6)?, @@ -249,14 +256,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2004, 1, 12)?, @@ -313,14 +320,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2005, 1, 10)?, @@ -374,14 +381,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2006, 1, 9)?, @@ -438,14 +445,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2007, 1, 8)?, @@ -499,14 +506,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2008, 1, 7)?, @@ -563,14 +570,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2009, 1, 12)?, @@ -624,14 +631,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2010, 1, 11)?, @@ -688,14 +695,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2011, 1, 10)?, @@ -745,14 +752,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2012, 1, 9)?, @@ -806,14 +813,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2013, 1, 7)?, @@ -870,14 +877,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2014, 1, 6)?, @@ -930,14 +937,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2015, 1, 12)?, @@ -991,14 +998,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2016, 1, 11)?, @@ -1052,14 +1059,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2017, 1, 9)?, @@ -1116,14 +1123,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2018, 1, 8)?, @@ -1177,14 +1184,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2019, 1, 7)?, @@ -1237,14 +1244,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2020, 1, 6)?, @@ -1298,14 +1305,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2021, 1, 11)?, @@ -1362,14 +1369,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2022, 1, 10)?, @@ -1423,14 +1430,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2023, 1, 9)?, @@ -1487,14 +1494,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2024, 1, 8)?, @@ -1551,14 +1558,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2025, 1, 6)?, @@ -1611,14 +1618,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2026, 1, 12)?, @@ -1672,14 +1679,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2027, 1, 11)?, @@ -1736,14 +1743,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2028, 1, 10)?, @@ -1800,14 +1807,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2029, 1, 8)?, @@ -1861,14 +1868,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2030, 1, 7)?, @@ -1921,8 +1928,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Navidad"), ], &mut map, - Country::CO, - "Colombia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/cu.rs b/src/data/cu.rs index 62c8c1b..f0fa486 100644 --- a/src/data/cu.rs +++ b/src/data/cu.rs @@ -1,17 +1,24 @@ //! Cuba +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Cuba"; +const COUNTY_CODE: Country = Country::CU; + /// Generate holiday map for Cuba. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 1)?, "Triunfo de la Revolución", @@ -39,14 +46,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 1)?, "Triunfo de la Revolución", @@ -74,14 +81,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 1)?, "Triunfo de la Revolución", @@ -109,14 +116,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 1)?, "Triunfo de la Revolución", @@ -144,14 +151,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 1)?, "Triunfo de la Revolución", @@ -183,14 +190,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 1)?, "Triunfo de la Revolución", @@ -222,14 +229,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 1)?, "Triunfo de la Revolución", @@ -261,14 +268,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Triunfo de la Revolución", @@ -300,14 +307,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 1)?, "Triunfo de la Revolución", @@ -340,14 +347,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 1)?, "Triunfo de la Revolución", @@ -380,14 +387,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 1)?, "Triunfo de la Revolución", @@ -424,14 +431,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 1)?, "Triunfo de la Revolución", @@ -468,14 +475,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 1)?, "Triunfo de la Revolución", @@ -512,14 +519,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 1)?, "Triunfo de la Revolución", @@ -553,14 +560,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 1)?, "Triunfo de la Revolución", @@ -594,14 +601,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 1, 1)?, "Triunfo de la Revolución", @@ -635,14 +642,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 1)?, "Triunfo de la Revolución", @@ -680,14 +687,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 1)?, "Triunfo de la Revolución", @@ -721,14 +728,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 1)?, "Triunfo de la Revolución", @@ -762,14 +769,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 1)?, "Triunfo de la Revolución", @@ -803,14 +810,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 1)?, "Triunfo de la Revolución", @@ -844,14 +851,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 1)?, "Triunfo de la Revolución", @@ -889,14 +896,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 1)?, "Triunfo de la Revolución", @@ -934,14 +941,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 1)?, "Triunfo de la Revolución", @@ -975,14 +982,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 1)?, "Triunfo de la Revolución", @@ -1016,14 +1023,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 1)?, "Triunfo de la Revolución", @@ -1057,14 +1064,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 1)?, "Triunfo de la Revolución", @@ -1098,14 +1105,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 1)?, "Triunfo de la Revolución", @@ -1143,14 +1150,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 1)?, "Triunfo de la Revolución", @@ -1184,14 +1191,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 1)?, "Triunfo de la Revolución", @@ -1225,14 +1232,14 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 1)?, "Triunfo de la Revolución", @@ -1266,8 +1273,8 @@ pub fn build( ), ], &mut map, - Country::CU, - "Cuba", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/cw.rs b/src/data/cw.rs index 825b4b1..507afc5 100644 --- a/src/data/cw.rs +++ b/src/data/cw.rs @@ -1,17 +1,24 @@ //! Curaçao +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Curaçao"; +const COUNTY_CODE: Country = Country::CW; + /// Generate holiday map for Curaçao. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2000, 3, 6)?, @@ -40,14 +47,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2001, 2, 26)?, @@ -76,14 +83,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2002, 2, 11)?, @@ -112,14 +119,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2003, 3, 3)?, @@ -148,14 +155,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2004, 2, 23)?, @@ -184,14 +191,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2005, 2, 7)?, @@ -220,14 +227,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2006, 2, 27)?, @@ -256,14 +263,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2007, 2, 19)?, @@ -289,14 +296,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2008, 2, 4)?, @@ -327,14 +334,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2009, 2, 23)?, @@ -363,14 +370,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2010, 2, 15)?, @@ -397,14 +404,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2011, 3, 7)?, @@ -434,14 +441,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2012, 2, 20)?, @@ -468,14 +475,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2013, 2, 11)?, @@ -505,14 +512,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2014, 3, 3)?, @@ -542,14 +549,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2015, 2, 16)?, @@ -576,14 +583,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2016, 2, 8)?, @@ -613,14 +620,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2017, 2, 27)?, @@ -650,14 +657,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2018, 2, 12)?, @@ -684,14 +691,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2019, 3, 4)?, @@ -721,14 +728,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2020, 2, 24)?, @@ -758,14 +765,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2021, 2, 15)?, @@ -792,14 +799,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2022, 2, 28)?, @@ -829,14 +836,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2023, 2, 20)?, @@ -863,14 +870,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2024, 2, 12)?, @@ -900,14 +907,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2025, 3, 3)?, @@ -937,14 +944,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2026, 2, 16)?, @@ -971,14 +978,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2027, 2, 8)?, @@ -1008,14 +1015,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2028, 2, 28)?, @@ -1045,14 +1052,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2029, 2, 12)?, @@ -1079,14 +1086,14 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Aña Nobo"), ( NaiveDate::from_ymd_res(2030, 3, 4)?, @@ -1116,8 +1123,8 @@ pub fn build( ), ], &mut map, - Country::CW, - "Curaçao", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/cy.rs b/src/data/cy.rs index 565358e..2072884 100644 --- a/src/data/cy.rs +++ b/src/data/cy.rs @@ -1,17 +1,24 @@ //! Cyprus +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Cyprus"; +const COUNTY_CODE: Country = Country::CY; + /// Generate holiday map for Cyprus. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2000, 3, 13)?, "Καθαρά Δευτέρα"), @@ -46,14 +53,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2001, 2, 26)?, "Καθαρά Δευτέρα"), @@ -89,14 +96,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2002, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2002, 3, 18)?, "Καθαρά Δευτέρα"), @@ -132,14 +139,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2003, 3, 10)?, "Καθαρά Δευτέρα"), @@ -175,14 +182,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2004, 2, 23)?, "Καθαρά Δευτέρα"), @@ -218,14 +225,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2005, 3, 14)?, "Καθαρά Δευτέρα"), @@ -263,14 +270,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2006, 3, 6)?, "Καθαρά Δευτέρα"), @@ -306,14 +313,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2007, 2, 19)?, "Καθαρά Δευτέρα"), @@ -349,14 +356,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2008, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2008, 3, 10)?, "Καθαρά Δευτέρα"), @@ -392,14 +399,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2009, 3, 2)?, "Καθαρά Δευτέρα"), @@ -435,14 +442,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2010, 2, 15)?, "Καθαρά Δευτέρα"), @@ -478,14 +485,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2011, 3, 7)?, "Καθαρά Δευτέρα"), @@ -521,14 +528,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2012, 2, 27)?, "Καθαρά Δευτέρα"), @@ -564,14 +571,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2013, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2013, 3, 18)?, "Καθαρά Δευτέρα"), @@ -607,14 +614,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2014, 3, 3)?, "Καθαρά Δευτέρα"), @@ -650,14 +657,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2015, 2, 23)?, "Καθαρά Δευτέρα"), @@ -693,14 +700,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2016, 3, 14)?, "Καθαρά Δευτέρα"), @@ -738,14 +745,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2017, 2, 27)?, "Καθαρά Δευτέρα"), @@ -781,14 +788,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2018, 2, 19)?, "Καθαρά Δευτέρα"), @@ -824,14 +831,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2019, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2019, 3, 11)?, "Καθαρά Δευτέρα"), @@ -867,14 +874,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2020, 3, 2)?, "Καθαρά Δευτέρα"), @@ -910,14 +917,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2021, 3, 15)?, "Καθαρά Δευτέρα"), @@ -953,14 +960,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2022, 3, 7)?, "Καθαρά Δευτέρα"), @@ -996,14 +1003,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2023, 2, 27)?, "Καθαρά Δευτέρα"), @@ -1039,14 +1046,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2024, 3, 18)?, "Καθαρά Δευτέρα"), @@ -1082,14 +1089,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2025, 3, 3)?, "Καθαρά Δευτέρα"), @@ -1125,14 +1132,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2026, 2, 23)?, "Καθαρά Δευτέρα"), @@ -1168,14 +1175,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2027, 3, 15)?, "Καθαρά Δευτέρα"), @@ -1211,14 +1218,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2028, 2, 28)?, "Καθαρά Δευτέρα"), @@ -1254,14 +1261,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2029, 2, 19)?, "Καθαρά Δευτέρα"), @@ -1297,14 +1304,14 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Ημέρα των Θεοφανίων"), (NaiveDate::from_ymd_res(2030, 3, 11)?, "Καθαρά Δευτέρα"), @@ -1340,8 +1347,8 @@ pub fn build( ), ], &mut map, - Country::CY, - "Cyprus", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/cz.rs b/src/data/cz.rs index 3c9d059..584c8fa 100644 --- a/src/data/cz.rs +++ b/src/data/cz.rs @@ -1,17 +1,24 @@ //! Czechia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Czechia"; +const COUNTY_CODE: Country = Country::CZ; + /// Generate holiday map for Czechia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 1)?, "Den obnovy samostatného českého státu", @@ -41,14 +48,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 1)?, "Den obnovy samostatného českého státu", @@ -78,14 +85,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 1)?, "Den obnovy samostatného českého státu", @@ -115,14 +122,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 1)?, "Den obnovy samostatného českého státu", @@ -152,14 +159,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 1)?, "Den obnovy samostatného českého státu", @@ -189,14 +196,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 1)?, "Den obnovy samostatného českého státu", @@ -226,14 +233,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 1)?, "Den obnovy samostatného českého státu", @@ -263,14 +270,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Den obnovy samostatného českého státu", @@ -300,14 +307,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 1)?, "Den obnovy samostatného českého státu", @@ -337,14 +344,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 1)?, "Den obnovy samostatného českého státu", @@ -374,14 +381,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 1)?, "Den obnovy samostatného českého státu", @@ -411,14 +418,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 1)?, "Den obnovy samostatného českého státu", @@ -448,14 +455,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 1)?, "Den obnovy samostatného českého státu", @@ -485,14 +492,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 1)?, "Den obnovy samostatného českého státu", @@ -522,14 +529,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 1)?, "Den obnovy samostatného českého státu", @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 1, 1)?, "Den obnovy samostatného českého státu", @@ -596,14 +603,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 1)?, "Den obnovy samostatného českého státu", @@ -634,14 +641,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 1)?, "Den obnovy samostatného českého státu", @@ -672,14 +679,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 1)?, "Den obnovy samostatného českého státu", @@ -710,14 +717,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 1)?, "Den obnovy samostatného českého státu", @@ -748,14 +755,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 1)?, "Den obnovy samostatného českého státu", @@ -786,14 +793,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 1)?, "Den obnovy samostatného českého státu", @@ -824,14 +831,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 1)?, "Den obnovy samostatného českého státu", @@ -862,14 +869,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 1)?, "Den obnovy samostatného českého státu", @@ -900,14 +907,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 1)?, "Den obnovy samostatného českého státu", @@ -938,14 +945,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 1)?, "Den obnovy samostatného českého státu", @@ -976,14 +983,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 1)?, "Den obnovy samostatného českého státu", @@ -1014,14 +1021,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 1)?, "Den obnovy samostatného českého státu", @@ -1052,14 +1059,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 1)?, "Den obnovy samostatného českého státu", @@ -1090,14 +1097,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 1)?, "Den obnovy samostatného českého státu", @@ -1128,14 +1135,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 1)?, "Den obnovy samostatného českého státu", @@ -1166,8 +1173,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "2. svátek vánoční"), ], &mut map, - Country::CZ, - "Czechia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/de.rs b/src/data/de.rs index 09fc116..5496a7a 100644 --- a/src/data/de.rs +++ b/src/data/de.rs @@ -1,17 +1,24 @@ //! Germany +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Germany"; +const COUNTY_CODE: Country = Country::DE; + /// Generate holiday map for Germany. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Karfreitag"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Ostermontag"), @@ -32,14 +39,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Karfreitag"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Ostermontag"), @@ -60,14 +67,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Karfreitag"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Ostermontag"), @@ -88,14 +95,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Karfreitag"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Ostermontag"), @@ -116,14 +123,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Karfreitag"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Ostermontag"), @@ -144,14 +151,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Karfreitag"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Ostermontag"), @@ -172,14 +179,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Karfreitag"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Ostermontag"), @@ -200,14 +207,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Karfreitag"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Ostermontag"), @@ -228,14 +235,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Karfreitag"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Ostermontag"), @@ -258,14 +265,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Karfreitag"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Ostermontag"), @@ -286,14 +293,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Karfreitag"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Ostermontag"), @@ -314,14 +321,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Karfreitag"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Ostermontag"), @@ -342,14 +349,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Karfreitag"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Ostermontag"), @@ -370,14 +377,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Karfreitag"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Ostermontag"), @@ -398,14 +405,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Karfreitag"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Ostermontag"), @@ -426,14 +433,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Karfreitag"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Ostermontag"), @@ -454,14 +461,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Karfreitag"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Ostermontag"), @@ -482,14 +489,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Karfreitag"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Ostermontag"), @@ -511,14 +518,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 10, 31)?, "Reformationstag"), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Karfreitag"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Ostermontag"), @@ -539,14 +546,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Karfreitag"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Ostermontag"), @@ -567,14 +574,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Karfreitag"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Ostermontag"), @@ -595,14 +602,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Karfreitag"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Ostermontag"), @@ -623,14 +630,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Karfreitag"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Ostermontag"), @@ -651,14 +658,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Karfreitag"), (NaiveDate::from_ymd_res(2023, 4, 10)?, "Ostermontag"), @@ -679,14 +686,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Karfreitag"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Ostermontag"), @@ -707,14 +714,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Karfreitag"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Ostermontag"), @@ -735,14 +742,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Karfreitag"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Ostermontag"), @@ -763,14 +770,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Karfreitag"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Ostermontag"), @@ -791,14 +798,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Karfreitag"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Ostermontag"), @@ -819,14 +826,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Karfreitag"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Ostermontag"), @@ -847,14 +854,14 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Karfreitag"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Ostermontag"), @@ -875,8 +882,8 @@ pub fn build( ), ], &mut map, - Country::DE, - "Germany", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/de_bb.rs b/src/data/de_bb.rs new file mode 100644 index 0000000..5856549 --- /dev/null +++ b/src/data/de_bb.rs @@ -0,0 +1,423 @@ +//! Germany (Brandenburg) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Brandenburg)"; +const COUNTY_CODE: Country = Country::DE_BB; + +/// Generate holiday map for Germany (Brandenburg). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 4, 23)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2000, 6, 11)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2000, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 4, 15)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2001, 6, 3)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2001, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 3, 31)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2002, 5, 19)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2002, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 4, 20)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2003, 6, 8)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2003, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 4, 11)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2004, 5, 30)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2004, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 3, 27)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2005, 5, 15)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2005, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 4, 16)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2006, 6, 4)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2006, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 4, 8)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2007, 5, 27)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2007, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 23)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2008, 5, 11)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2008, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 4, 12)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2009, 5, 31)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2009, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 4, 4)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2010, 5, 23)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2010, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 4, 24)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2011, 6, 12)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2011, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 4, 8)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2012, 5, 27)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2012, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 31)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2013, 5, 19)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2013, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 4, 20)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2014, 6, 8)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2014, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 4, 5)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2015, 5, 24)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2015, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 27)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2016, 5, 15)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2016, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 4, 16)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2017, 6, 4)?, "Pfingstsonntag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 4, 1)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2018, 5, 20)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 4, 21)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2019, 6, 9)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 4, 12)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2020, 5, 31)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 4, 4)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2021, 5, 23)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 4, 17)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2022, 6, 5)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 4, 9)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2023, 5, 28)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 31)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2024, 5, 19)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 4, 20)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2025, 6, 8)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 4, 5)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2026, 5, 24)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 28)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2027, 5, 16)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 4, 16)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2028, 6, 4)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 4, 1)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2029, 5, 20)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 4, 21)?, "Ostersonntag"), + (NaiveDate::from_ymd_res(2030, 6, 9)?, "Pfingstsonntag"), + (NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_be.rs b/src/data/de_be.rs new file mode 100644 index 0000000..3eb9602 --- /dev/null +++ b/src/data/de_be.rs @@ -0,0 +1,203 @@ +//! Germany (Berlin) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Berlin)"; +const COUNTY_CODE: Country = Country::DE_BE; + +/// Generate holiday map for Germany (Berlin). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2019, + [( + NaiveDate::from_ymd_res(2019, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 3, 8)?, "Internationaler Frauentag"), + (NaiveDate::from_ymd_res(2020, 5, 8)?, "75. Jahrestag der Befreiung vom Nationalsozialismus und der Beendigung des Zweiten Weltkriegs in Europa"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [( + NaiveDate::from_ymd_res(2022, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [( + NaiveDate::from_ymd_res(2023, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [( + NaiveDate::from_ymd_res(2024, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [( + NaiveDate::from_ymd_res(2025, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [( + NaiveDate::from_ymd_res(2026, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [( + NaiveDate::from_ymd_res(2028, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [( + NaiveDate::from_ymd_res(2029, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [( + NaiveDate::from_ymd_res(2030, 3, 8)?, + "Internationaler Frauentag", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_bw.rs b/src/data/de_bw.rs new file mode 100644 index 0000000..d550755 --- /dev/null +++ b/src/data/de_bw.rs @@ -0,0 +1,424 @@ +//! Germany (Baden-Württemberg) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Baden-Württemberg)"; +const COUNTY_CODE: Country = Country::DE_BW; + +/// Generate holiday map for Germany (Baden-Württemberg). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2000, 6, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2000, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2001, 6, 14)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2001, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2002, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2002, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2003, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2003, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2004, 6, 10)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2004, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2005, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2005, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2006, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2006, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2007, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2007, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2008, 5, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2008, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2009, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2009, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2010, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2010, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2011, 6, 23)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2011, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2012, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2012, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2013, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2013, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2014, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2014, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2015, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2015, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2016, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2016, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2017, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2017, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2018, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2018, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2019, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2019, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2021, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2022, 6, 16)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2023, 6, 8)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2024, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2025, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2026, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2027, 5, 27)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2028, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2029, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2030, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_by.rs b/src/data/de_by.rs new file mode 100644 index 0000000..5a96618 --- /dev/null +++ b/src/data/de_by.rs @@ -0,0 +1,455 @@ +//! Germany (Bavaria (Bayern)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Bavaria (Bayern))"; +const COUNTY_CODE: Country = Country::DE_BY; + +/// Generate holiday map for Germany (Bavaria (Bayern)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2000, 6, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2000, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2000, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2001, 6, 14)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2001, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2001, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2002, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2002, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2002, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2003, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2003, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2003, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2004, 6, 10)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2004, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2004, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2005, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2005, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2005, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2006, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2006, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2006, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2007, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2007, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2007, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2008, 5, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2008, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2008, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2009, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2009, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2009, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2010, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2010, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2010, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2011, 6, 23)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2011, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2011, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2012, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2012, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2012, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2013, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2013, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2013, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2014, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2014, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2014, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2015, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2015, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2015, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2016, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2016, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2016, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2017, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2017, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2017, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2018, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2018, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2018, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2019, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2019, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2019, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2020, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2021, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2021, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2022, 6, 16)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2022, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2023, 6, 8)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2023, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2024, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2024, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2025, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2025, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2026, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2026, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2027, 5, 27)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2027, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2028, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2028, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2029, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2029, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2030, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2030, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_byp.rs b/src/data/de_byp.rs new file mode 100644 index 0000000..b48e78f --- /dev/null +++ b/src/data/de_byp.rs @@ -0,0 +1,424 @@ +//! Germany (Bavaria (Bayern) with more protestants) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Bavaria (Bayern) with more protestants)"; +const COUNTY_CODE: Country = Country::DE_BYP; + +/// Generate holiday map for Germany (Bavaria (Bayern) with more protestants). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2000, 6, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2000, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2001, 6, 14)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2001, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2002, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2002, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2003, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2003, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2004, 6, 10)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2004, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2005, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2005, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2006, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2006, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2007, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2007, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2008, 5, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2008, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2009, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2009, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2010, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2010, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2011, 6, 23)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2011, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2012, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2012, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2013, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2013, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2014, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2014, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2015, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2015, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2016, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2016, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2017, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2017, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2018, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2018, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2019, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2019, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2021, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2022, 6, 16)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2023, 6, 8)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2024, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2025, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2026, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2027, 5, 27)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2028, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2029, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2030, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_hb.rs b/src/data/de_hb.rs new file mode 100644 index 0000000..ca39f1d --- /dev/null +++ b/src/data/de_hb.rs @@ -0,0 +1,174 @@ +//! Germany (Bremen) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Bremen)"; +const COUNTY_CODE: Country = Country::DE_HB; + +/// Generate holiday map for Germany (Bremen). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_he.rs b/src/data/de_he.rs new file mode 100644 index 0000000..a83a050 --- /dev/null +++ b/src/data/de_he.rs @@ -0,0 +1,300 @@ +//! Germany (Hesse (Hessen)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Hesse (Hessen))"; +const COUNTY_CODE: Country = Country::DE_HE; + +/// Generate holiday map for Germany (Hesse (Hessen)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 6, 22)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 6, 14)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 5, 30)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 6, 19)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 6, 10)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 5, 26)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 6, 15)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 6, 7)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 5, 22)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 6, 11)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 6, 3)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 6, 23)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 6, 7)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 5, 30)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 6, 19)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 6, 4)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 5, 26)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 6, 15)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 5, 31)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 6, 20)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 6, 11)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 6, 3)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 6, 16)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 6, 8)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 5, 30)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 6, 19)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 6, 4)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 5, 27)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 6, 15)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 5, 31)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 6, 20)?, "Fronleichnam")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_hh.rs b/src/data/de_hh.rs new file mode 100644 index 0000000..10c3987 --- /dev/null +++ b/src/data/de_hh.rs @@ -0,0 +1,174 @@ +//! Germany (Hamburg) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Hamburg)"; +const COUNTY_CODE: Country = Country::DE_HH; + +/// Generate holiday map for Germany (Hamburg). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_mv.rs b/src/data/de_mv.rs new file mode 100644 index 0000000..28fccbd --- /dev/null +++ b/src/data/de_mv.rs @@ -0,0 +1,341 @@ +//! Germany (Mecklenburg-Vorpommern) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Mecklenburg-Vorpommern)"; +const COUNTY_CODE: Country = Country::DE_MV; + +/// Generate holiday map for Germany (Mecklenburg-Vorpommern). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + ( + NaiveDate::from_ymd_res(2027, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 3, 8)?, + "Internationaler Frauentag", + ), + (NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_ni.rs b/src/data/de_ni.rs new file mode 100644 index 0000000..c4871e5 --- /dev/null +++ b/src/data/de_ni.rs @@ -0,0 +1,174 @@ +//! Germany (Lower Saxony (Niedersachsen)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Lower Saxony (Niedersachsen))"; +const COUNTY_CODE: Country = Country::DE_NI; + +/// Generate holiday map for Germany (Lower Saxony (Niedersachsen)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_nw.rs b/src/data/de_nw.rs new file mode 100644 index 0000000..6f9058f --- /dev/null +++ b/src/data/de_nw.rs @@ -0,0 +1,393 @@ +//! Germany (North Rhine-Westphalia (Nordrhein-Westfalen)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (North Rhine-Westphalia (Nordrhein-Westfalen))"; +const COUNTY_CODE: Country = Country::DE_NW; + +/// Generate holiday map for Germany (North Rhine-Westphalia (Nordrhein-Westfalen)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 6, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2000, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 6, 14)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2001, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2002, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2003, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 6, 10)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2004, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2005, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2006, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2007, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 5, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2008, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2009, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2010, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 6, 23)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2011, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2012, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2013, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2014, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2015, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2016, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2017, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2018, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2019, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 6, 16)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 6, 8)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 5, 27)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_rp.rs b/src/data/de_rp.rs new file mode 100644 index 0000000..a867d6a --- /dev/null +++ b/src/data/de_rp.rs @@ -0,0 +1,393 @@ +//! Germany (Rhineland-Palatinate (Rheinland-Pfalz)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Rhineland-Palatinate (Rheinland-Pfalz))"; +const COUNTY_CODE: Country = Country::DE_RP; + +/// Generate holiday map for Germany (Rhineland-Palatinate (Rheinland-Pfalz)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 6, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2000, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 6, 14)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2001, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2002, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2003, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 6, 10)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2004, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2005, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2006, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2007, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 5, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2008, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2009, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2010, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 6, 23)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2011, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2012, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2013, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2014, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2015, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2016, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2017, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2018, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2019, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 6, 16)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 6, 8)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 5, 27)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_sh.rs b/src/data/de_sh.rs new file mode 100644 index 0000000..5a827b1 --- /dev/null +++ b/src/data/de_sh.rs @@ -0,0 +1,174 @@ +//! Germany (Schleswig-Holstein) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Schleswig-Holstein)"; +const COUNTY_CODE: Country = Country::DE_SH; + +/// Generate holiday map for Germany (Schleswig-Holstein). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_sl.rs b/src/data/de_sl.rs new file mode 100644 index 0000000..be100eb --- /dev/null +++ b/src/data/de_sl.rs @@ -0,0 +1,424 @@ +//! Germany (Saarland) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Saarland)"; +const COUNTY_CODE: Country = Country::DE_SL; + +/// Generate holiday map for Germany (Saarland). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 6, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2000, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2000, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 6, 14)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2001, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2001, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2002, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2002, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2003, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2003, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 6, 10)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2004, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2004, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2005, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2005, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2006, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2006, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2007, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2007, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 5, 22)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2008, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2008, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2009, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2009, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2010, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2010, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 6, 23)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2011, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2011, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 6, 7)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2012, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2012, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2013, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2013, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2014, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2014, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2015, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2015, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 5, 26)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2016, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2016, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2017, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2017, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2018, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2018, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2019, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2019, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2020, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 6, 3)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2021, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 6, 16)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2022, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 6, 8)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2023, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 5, 30)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2024, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 6, 19)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2025, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 6, 4)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2026, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 5, 27)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2027, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 6, 15)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2028, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 5, 31)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2029, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 6, 20)?, "Fronleichnam"), + (NaiveDate::from_ymd_res(2030, 8, 15)?, "Mariä Himmelfahrt"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Allerheiligen"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_sn.rs b/src/data/de_sn.rs new file mode 100644 index 0000000..e857faf --- /dev/null +++ b/src/data/de_sn.rs @@ -0,0 +1,390 @@ +//! Germany (Saxony (Sachsen)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Saxony (Sachsen))"; +const COUNTY_CODE: Country = Country::DE_SN; + +/// Generate holiday map for Germany (Saxony (Sachsen)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2000, 11, 22)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2001, 11, 21)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2002, 11, 20)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2003, 11, 19)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2004, 11, 17)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2005, 11, 16)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2006, 11, 22)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2007, 11, 21)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2008, 11, 19)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2009, 11, 18)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2010, 11, 17)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2011, 11, 16)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2012, 11, 21)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2013, 11, 20)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2014, 11, 19)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2015, 11, 18)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2016, 11, 16)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 11, 22)?, "Buß- und Bettag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2018, 11, 21)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2019, 11, 20)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2020, 11, 18)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2021, 11, 17)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2022, 11, 16)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2023, 11, 22)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2024, 11, 20)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2025, 11, 19)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2026, 11, 18)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2027, 11, 17)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2028, 11, 22)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2029, 11, 21)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag"), + (NaiveDate::from_ymd_res(2030, 11, 20)?, "Buß- und Bettag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_st.rs b/src/data/de_st.rs new file mode 100644 index 0000000..0b08c1a --- /dev/null +++ b/src/data/de_st.rs @@ -0,0 +1,390 @@ +//! Germany (Saxony-Anhalt (Sachsen-Anhalt)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Saxony-Anhalt (Sachsen-Anhalt))"; +const COUNTY_CODE: Country = Country::DE_ST; + +/// Generate holiday map for Germany (Saxony-Anhalt (Sachsen-Anhalt)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2000, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2001, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2002, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2003, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2004, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2005, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2006, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2007, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2008, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2009, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2010, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2011, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2012, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2013, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2014, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2015, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2016, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 1, 6)?, "Heilige Drei Könige")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 6)?, "Heilige Drei Könige"), + (NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/de_th.rs b/src/data/de_th.rs new file mode 100644 index 0000000..3c5d357 --- /dev/null +++ b/src/data/de_th.rs @@ -0,0 +1,329 @@ +//! Germany (Thuringia (Thüringen)) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "Germany (Thuringia (Thüringen))"; +const COUNTY_CODE: Country = Country::DE_TH; + +/// Generate holiday map for Germany (Thuringia (Thüringen)). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 10, 31)?, "Reformationstag")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2019, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2020, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2021, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2022, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2023, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2024, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2025, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2026, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2027, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2028, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2029, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 9, 20)?, "Weltkindertag"), + (NaiveDate::from_ymd_res(2030, 10, 31)?, "Reformationstag"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/dj.rs b/src/data/dj.rs index 7e2972e..543bec9 100644 --- a/src/data/dj.rs +++ b/src/data/dj.rs @@ -1,17 +1,24 @@ //! Djibouti +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Djibouti"; +const COUNTY_CODE: Country = Country::DJ; + /// Generate holiday map for Djibouti. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2000, 5, 1)?, "Fête du travail"), ( @@ -59,14 +66,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2001, 5, 1)?, "Fête du travail"), ( @@ -106,14 +113,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2002, 5, 1)?, "Fête du travail"), ( @@ -156,14 +163,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2003, 5, 1)?, "Fête du travail"), ( @@ -206,14 +213,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Nouvel an"), ( NaiveDate::from_ymd_res(2004, 5, 1)?, @@ -252,14 +259,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2005, 5, 1)?, "Fête du travail"), ( @@ -302,14 +309,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2006, 5, 1)?, "Fête du travail"), ( @@ -357,14 +364,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Eid al-Adha deuxième jour (estimé); Nouvel an", @@ -410,14 +417,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2008, 5, 1)?, "Fête du travail"), ( @@ -464,14 +471,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2009, 5, 1)?, "Fête du travail"), ( @@ -514,14 +521,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2010, 5, 1)?, "Fête du travail"), ( @@ -564,14 +571,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2011, 5, 1)?, "Fête du travail"), ( @@ -614,14 +621,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2012, 5, 1)?, "Fête du travail"), ( @@ -664,14 +671,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2013, 5, 1)?, "Fête du travail"), ( @@ -711,14 +718,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2014, 5, 1)?, "Fête du travail"), ( @@ -761,14 +768,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2015, 5, 1)?, "Fête du travail"), ( @@ -815,14 +822,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2016, 5, 1)?, "Fête du travail"), ( @@ -862,14 +869,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2017, 5, 1)?, "Fête du travail"), ( @@ -909,14 +916,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2018, 5, 1)?, "Fête du travail"), ( @@ -959,14 +966,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2019, 5, 1)?, "Fête du travail"), ( @@ -1006,14 +1013,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2020, 5, 1)?, "Fête du travail"), ( @@ -1056,14 +1063,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2021, 5, 1)?, "Fête du travail"), ( @@ -1106,14 +1113,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2022, 5, 1)?, "Fête du travail"), ( @@ -1150,14 +1157,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2023, 5, 1)?, "Fête du travail"), ( @@ -1195,14 +1202,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2024, 5, 1)?, "Fête du travail"), ( @@ -1245,14 +1252,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2025, 5, 1)?, "Fête du travail"), ( @@ -1292,14 +1299,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2026, 5, 1)?, "Fête du travail"), ( @@ -1342,14 +1349,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2027, 5, 1)?, "Fête du travail"), ( @@ -1392,14 +1399,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2028, 5, 1)?, "Fête du travail"), ( @@ -1439,14 +1446,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2029, 5, 1)?, "Fête du travail"), ( @@ -1489,14 +1496,14 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nouvel an"), (NaiveDate::from_ymd_res(2030, 5, 1)?, "Fête du travail"), ( @@ -1536,8 +1543,8 @@ pub fn build( ), ], &mut map, - Country::DJ, - "Djibouti", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/dk.rs b/src/data/dk.rs index b35b2fb..0905f66 100644 --- a/src/data/dk.rs +++ b/src/data/dk.rs @@ -1,17 +1,24 @@ //! Denmark +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Denmark"; +const COUNTY_CODE: Country = Country::DK; + /// Generate holiday map for Denmark. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2000, 4, 20)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Langfredag"), @@ -28,14 +35,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2001, 4, 12)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Langfredag"), @@ -52,14 +59,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2002, 3, 28)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Langfredag"), @@ -76,14 +83,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2003, 4, 17)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Langfredag"), @@ -100,14 +107,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2004, 4, 8)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Langfredag"), @@ -124,14 +131,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2005, 3, 24)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Langfredag"), @@ -148,14 +155,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2006, 4, 13)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Langfredag"), @@ -172,14 +179,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2007, 4, 5)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Langfredag"), @@ -196,14 +203,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2008, 3, 20)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Langfredag"), @@ -220,14 +227,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2009, 4, 9)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Langfredag"), @@ -244,14 +251,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2010, 4, 1)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Langfredag"), @@ -268,14 +275,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2011, 4, 21)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Langfredag"), @@ -292,14 +299,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2012, 4, 5)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Langfredag"), @@ -316,14 +323,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2013, 3, 28)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Langfredag"), @@ -340,14 +347,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2014, 4, 17)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Langfredag"), @@ -364,14 +371,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2015, 4, 2)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Langfredag"), @@ -388,14 +395,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2016, 3, 24)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Langfredag"), @@ -412,14 +419,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2017, 4, 13)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Langfredag"), @@ -436,14 +443,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2018, 3, 29)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Langfredag"), @@ -460,14 +467,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2019, 4, 18)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Langfredag"), @@ -484,14 +491,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2020, 4, 9)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Langfredag"), @@ -508,14 +515,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2021, 4, 1)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Langfredag"), @@ -532,14 +539,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2022, 4, 14)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Langfredag"), @@ -556,14 +563,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2023, 4, 6)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Langfredag"), @@ -580,14 +587,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2024, 3, 28)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Langfredag"), @@ -603,14 +610,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2025, 4, 17)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Langfredag"), @@ -626,14 +633,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2026, 4, 2)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Langfredag"), @@ -649,14 +656,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2027, 3, 25)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Langfredag"), @@ -672,14 +679,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2028, 4, 13)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Langfredag"), @@ -695,14 +702,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2029, 3, 29)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Langfredag"), @@ -718,14 +725,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nytårsdag"), (NaiveDate::from_ymd_res(2030, 4, 18)?, "Skærtorsdag"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Langfredag"), @@ -741,8 +748,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Anden juledag"), ], &mut map, - Country::DK, - "Denmark", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/do.rs b/src/data/do.rs index 239eb40..c118e7f 100644 --- a/src/data/do.rs +++ b/src/data/do.rs @@ -1,17 +1,24 @@ //! Dominican Republic +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Dominican Republic"; +const COUNTY_CODE: Country = Country::DO; + /// Generate holiday map for Dominican Republic. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2000, 1, 10)?, @@ -41,14 +48,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2001, 1, 6)?, @@ -78,14 +85,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2002, 1, 6)?, @@ -115,14 +122,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2003, 1, 6)?, @@ -152,14 +159,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2004, 1, 5)?, @@ -189,14 +196,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2005, 1, 10)?, @@ -226,14 +233,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2006, 1, 9)?, @@ -263,14 +270,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2007, 1, 6)?, @@ -300,14 +307,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2008, 1, 6)?, @@ -337,14 +344,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2009, 1, 5)?, @@ -374,14 +381,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2010, 1, 4)?, @@ -411,14 +418,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2011, 1, 10)?, @@ -448,14 +455,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2012, 1, 9)?, @@ -485,14 +492,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2013, 1, 6)?, @@ -522,14 +529,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2014, 1, 6)?, @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2015, 1, 5)?, @@ -596,14 +603,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2016, 1, 4)?, @@ -633,14 +640,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2017, 1, 9)?, @@ -670,14 +677,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2018, 1, 6)?, @@ -707,14 +714,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2019, 1, 6)?, @@ -744,14 +751,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2020, 1, 6)?, @@ -781,14 +788,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2021, 1, 4)?, @@ -818,14 +825,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2022, 1, 10)?, @@ -855,14 +862,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2023, 1, 9)?, @@ -892,14 +899,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2024, 1, 6)?, @@ -929,14 +936,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2025, 1, 6)?, @@ -966,14 +973,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2026, 1, 5)?, @@ -1003,14 +1010,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2027, 1, 4)?, @@ -1040,14 +1047,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2028, 1, 10)?, @@ -1077,14 +1084,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2029, 1, 6)?, @@ -1114,14 +1121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2030, 1, 6)?, @@ -1151,8 +1158,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Día de Navidad"), ], &mut map, - Country::DO, - "Dominican Republic", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ee.rs b/src/data/ee.rs index d38c884..1be87d1 100644 --- a/src/data/ee.rs +++ b/src/data/ee.rs @@ -1,17 +1,24 @@ //! Estonia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Estonia"; +const COUNTY_CODE: Country = Country::EE; + /// Generate holiday map for Estonia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2000, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "suur reede"), @@ -31,14 +38,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2001, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "suur reede"), @@ -58,14 +65,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2002, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "suur reede"), @@ -85,14 +92,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2003, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "suur reede"), @@ -112,14 +119,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2004, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "suur reede"), @@ -139,14 +146,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2005, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "suur reede"), @@ -167,14 +174,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2006, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "suur reede"), @@ -195,14 +202,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2007, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "suur reede"), @@ -223,14 +230,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2008, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "suur reede"), @@ -251,14 +258,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2009, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "suur reede"), @@ -279,14 +286,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2010, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "suur reede"), @@ -307,14 +314,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2011, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "suur reede"), @@ -335,14 +342,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2012, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "suur reede"), @@ -363,14 +370,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2013, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "suur reede"), @@ -391,14 +398,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2014, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "suur reede"), @@ -419,14 +426,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2015, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "suur reede"), @@ -447,14 +454,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2016, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "suur reede"), @@ -475,14 +482,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2017, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "suur reede"), @@ -503,14 +510,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2018, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "suur reede"), @@ -531,14 +538,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2019, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "suur reede"), @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2020, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "suur reede"), @@ -587,14 +594,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2021, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "suur reede"), @@ -615,14 +622,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2022, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "suur reede"), @@ -643,14 +650,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2023, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "suur reede"), @@ -671,14 +678,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2024, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "suur reede"), @@ -699,14 +706,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2025, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "suur reede"), @@ -727,14 +734,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2026, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "suur reede"), @@ -755,14 +762,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2027, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "suur reede"), @@ -783,14 +790,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2028, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "suur reede"), @@ -811,14 +818,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2029, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "suur reede"), @@ -839,14 +846,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "uusaasta"), (NaiveDate::from_ymd_res(2030, 2, 24)?, "iseseisvuspäev"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "suur reede"), @@ -867,8 +874,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "teine jõulupüha"), ], &mut map, - Country::EE, - "Estonia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/eg.rs b/src/data/eg.rs index 05b8840..60c84b3 100644 --- a/src/data/eg.rs +++ b/src/data/eg.rs @@ -1,17 +1,24 @@ //! Egypt +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Egypt"; +const COUNTY_CODE: Country = Country::EG; + /// Generate holiday map for Egypt. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2000, 1, 7)?, @@ -63,14 +70,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2001, 1, 7)?, @@ -111,14 +118,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2002, 1, 7)?, @@ -159,14 +166,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2003, 1, 7)?, @@ -207,14 +214,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2004, 1, 7)?, @@ -254,14 +261,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2005, 1, 7)?, @@ -304,14 +311,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2006, 1, 7)?, @@ -354,14 +361,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "(تقدير) عطلة عيد الأضحى; رأس السنة الميلادية", @@ -409,14 +416,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2008, 1, 7)?, @@ -461,14 +468,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2009, 1, 7)?, @@ -510,14 +517,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2010, 1, 7)?, @@ -559,14 +566,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2011, 1, 7)?, @@ -610,14 +617,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2012, 1, 7)?, @@ -659,14 +666,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2013, 1, 7)?, @@ -708,14 +715,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2014, 1, 7)?, @@ -757,14 +764,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2015, 1, 7)?, @@ -811,14 +818,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2016, 1, 7)?, @@ -863,14 +870,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2017, 1, 7)?, @@ -913,14 +920,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2018, 1, 7)?, @@ -963,14 +970,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2019, 1, 7)?, @@ -1013,14 +1020,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2020, 1, 7)?, @@ -1063,14 +1070,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2021, 1, 7)?, @@ -1113,14 +1120,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2022, 1, 7)?, @@ -1165,14 +1172,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2023, 1, 7)?, @@ -1214,14 +1221,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2024, 1, 7)?, @@ -1264,14 +1271,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2025, 1, 7)?, @@ -1314,14 +1321,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2026, 1, 7)?, @@ -1364,14 +1371,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2027, 1, 7)?, @@ -1414,14 +1421,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2028, 1, 7)?, @@ -1464,14 +1471,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2029, 1, 7)?, @@ -1513,14 +1520,14 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2030, 1, 7)?, @@ -1563,8 +1570,8 @@ pub fn build( ), ], &mut map, - Country::EG, - "Egypt", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/es.rs b/src/data/es.rs index 0af5838..3de5d3d 100644 --- a/src/data/es.rs +++ b/src/data/es.rs @@ -1,17 +1,24 @@ //! Spain +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Spain"; +const COUNTY_CODE: Country = Country::ES; + /// Generate holiday map for Spain. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Viernes Santo"), @@ -39,14 +46,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Viernes Santo"), @@ -74,14 +81,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2002, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Viernes Santo"), @@ -109,14 +116,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Viernes Santo"), @@ -144,14 +151,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Viernes Santo"), @@ -179,14 +186,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Viernes Santo"), @@ -214,14 +221,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Viernes Santo"), @@ -249,14 +256,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Viernes Santo"), @@ -284,14 +291,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2008, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Viernes Santo"), @@ -319,14 +326,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Viernes Santo"), @@ -354,14 +361,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Viernes Santo"), @@ -385,14 +392,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Viernes Santo"), @@ -415,14 +422,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2012, 5, 1)?, "Fiesta del Trabajo"), @@ -449,14 +456,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2013, 5, 1)?, "Fiesta del Trabajo"), @@ -479,14 +486,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Viernes Santo"), @@ -510,14 +517,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Viernes Santo"), @@ -540,14 +547,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Viernes Santo"), @@ -570,14 +577,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2017, 5, 1)?, "Fiesta del Trabajo"), @@ -604,14 +611,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Viernes Santo"), @@ -639,14 +646,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2019, 5, 1)?, "Fiesta del Trabajo"), @@ -669,14 +676,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Viernes Santo"), @@ -699,14 +706,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Viernes Santo"), @@ -730,14 +737,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Viernes Santo"), @@ -760,14 +767,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Viernes Santo"), (NaiveDate::from_ymd_res(2023, 5, 1)?, "Fiesta del Trabajo"), @@ -794,14 +801,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Viernes Santo"), @@ -825,14 +832,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Viernes Santo"), @@ -860,14 +867,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Viernes Santo"), @@ -895,14 +902,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Viernes Santo"), @@ -930,14 +937,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Viernes Santo"), @@ -965,14 +972,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Viernes Santo"), @@ -1000,14 +1007,14 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año nuevo"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Epifanía del Señor"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Viernes Santo"), @@ -1035,8 +1042,8 @@ pub fn build( ), ], &mut map, - Country::ES, - "Spain", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/et.rs b/src/data/et.rs index e689951..10d9643 100644 --- a/src/data/et.rs +++ b/src/data/et.rs @@ -1,17 +1,24 @@ //! Ethiopia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Ethiopia"; +const COUNTY_CODE: Country = Country::ET; + /// Generate holiday map for Ethiopia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2000, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2000, 3, 2)?, "አድዋ"), @@ -28,14 +35,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 6, 14)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2001, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2001, 3, 2)?, "አድዋ"), @@ -51,14 +58,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 6, 4)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2002, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2002, 3, 2)?, "አድዋ"), @@ -73,14 +80,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 5, 24)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2003, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2003, 3, 2)?, "አድዋ"), @@ -96,14 +103,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 5, 13)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2004, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2004, 3, 2)?, "አድዋ"), @@ -121,14 +128,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 2, 1)?, "አረፋ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2005, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2005, 3, 2)?, "አድዋ"), @@ -143,14 +150,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 4, 21)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2006, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2006, 3, 2)?, "አድዋ"), @@ -167,14 +174,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 4, 10)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2007, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2007, 3, 2)?, "አድዋ"), @@ -190,14 +197,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 3, 31)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2008, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2008, 3, 2)?, "አድዋ"), @@ -213,14 +220,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 3, 20)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2009, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2009, 3, 2)?, "አድዋ"), @@ -236,14 +243,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 3, 9)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2010, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2010, 3, 2)?, "አድዋ"), @@ -259,14 +266,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 2, 26)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2011, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2011, 3, 2)?, "አድዋ"), @@ -282,14 +289,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 2, 15)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2012, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2012, 3, 2)?, "አድዋ"), @@ -305,14 +312,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 2, 4)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2013, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2013, 3, 2)?, "አድዋ"), @@ -327,14 +334,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 1, 24)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2014, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2014, 3, 2)?, "አድዋ"), @@ -350,14 +357,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 1, 13)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2015, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2015, 3, 2)?, "አድዋ"), @@ -374,14 +381,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 23)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2016, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2016, 3, 2)?, "አድዋ"), @@ -395,14 +402,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 11)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2017, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2017, 3, 2)?, "አድዋ"), @@ -418,14 +425,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 11, 30)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2018, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2018, 3, 2)?, "አድዋ"), @@ -441,14 +448,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 11, 21)?, "መውሊድ"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2019, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2019, 3, 2)?, "አድዋ"), @@ -464,14 +471,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 11, 10)?, "መውሊድ"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2020, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2020, 3, 2)?, "አድዋ"), @@ -487,14 +494,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 10, 29)?, "መውሊድ"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2021, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2021, 3, 2)?, "አድዋ"), @@ -510,14 +517,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 10, 18)?, "መውሊድ"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2022, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2022, 3, 2)?, "አድዋ"), @@ -533,14 +540,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 10, 8)?, "መውሊድ"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2023, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2023, 3, 2)?, "አድዋ"), @@ -556,14 +563,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 9, 27)?, "መውሊድ"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2024, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2024, 3, 2)?, "አድዋ"), @@ -578,14 +585,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 9, 15)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2025, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2025, 3, 2)?, "አድዋ"), @@ -601,14 +608,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 9, 4)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2026, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2026, 3, 2)?, "አድዋ"), @@ -624,14 +631,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 8, 25)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2027, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2027, 3, 2)?, "አድዋ"), @@ -647,14 +654,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 8, 14)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2028, 1, 20)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2028, 3, 2)?, "አድዋ"), @@ -669,14 +676,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 8, 3)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2029, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2029, 3, 2)?, "አድዋ"), @@ -692,14 +699,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 7, 24)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 7)?, "ገና"), (NaiveDate::from_ymd_res(2030, 1, 19)?, "ጥምቀት"), (NaiveDate::from_ymd_res(2030, 3, 2)?, "አድዋ"), @@ -715,8 +722,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 7, 13)?, "መውሊድ (ግምት)"), ], &mut map, - Country::ET, - "Ethiopia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/fi.rs b/src/data/fi.rs index 3a0c930..ad80182 100644 --- a/src/data/fi.rs +++ b/src/data/fi.rs @@ -1,17 +1,24 @@ //! Finland +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Finland"; +const COUNTY_CODE: Country = Country::FI; + /// Generate holiday map for Finland. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Pitkäperjantai"), @@ -29,14 +36,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Pitkäperjantai"), @@ -54,14 +61,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2002, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Pitkäperjantai"), @@ -79,14 +86,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Pitkäperjantai"), @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Pitkäperjantai"), @@ -129,14 +136,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Pitkäperjantai"), @@ -154,14 +161,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Pitkäperjantai"), @@ -179,14 +186,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Pitkäperjantai"), @@ -204,14 +211,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2008, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Pitkäperjantai"), @@ -228,14 +235,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Pitkäperjantai"), @@ -253,14 +260,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Pitkäperjantai"), @@ -278,14 +285,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Pitkäperjantai"), @@ -303,14 +310,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Pitkäperjantai"), @@ -328,14 +335,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2013, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Pitkäperjantai"), @@ -353,14 +360,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Pitkäperjantai"), @@ -378,14 +385,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Pitkäperjantai"), @@ -403,14 +410,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Pitkäperjantai"), @@ -428,14 +435,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Pitkäperjantai"), @@ -453,14 +460,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Pitkäperjantai"), @@ -478,14 +485,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2019, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Pitkäperjantai"), @@ -503,14 +510,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Pitkäperjantai"), @@ -528,14 +535,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Pitkäperjantai"), @@ -553,14 +560,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Pitkäperjantai"), @@ -578,14 +585,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Pitkäperjantai"), @@ -603,14 +610,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Pitkäperjantai"), @@ -628,14 +635,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Pitkäperjantai"), @@ -653,14 +660,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Pitkäperjantai"), @@ -678,14 +685,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Pitkäperjantai"), @@ -703,14 +710,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Pitkäperjantai"), @@ -728,14 +735,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Pitkäperjantai"), @@ -753,14 +760,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Uudenvuodenpäivä"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Loppiainen"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Pitkäperjantai"), @@ -778,8 +785,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Tapaninpäivä"), ], &mut map, - Country::FI, - "Finland", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/fr.rs b/src/data/fr.rs index 26d5ff6..2b817ef 100644 --- a/src/data/fr.rs +++ b/src/data/fr.rs @@ -1,17 +1,24 @@ //! France +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "France"; +const COUNTY_CODE: Country = Country::FR; + /// Generate holiday map for France. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2000, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2000, 5, 8)?, "Fête de la Victoire"), @@ -25,14 +32,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2001, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2001, 5, 8)?, "Fête de la Victoire"), @@ -46,14 +53,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2002, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2002, 5, 8)?, "Fête de la Victoire"), @@ -67,14 +74,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2003, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2003, 5, 8)?, "Fête de la Victoire"), @@ -88,14 +95,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2004, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2004, 5, 8)?, "Fête de la Victoire"), @@ -109,14 +116,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2005, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2005, 5, 8)?, "Fête de la Victoire"), @@ -129,14 +136,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2006, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2006, 5, 8)?, "Fête de la Victoire"), @@ -149,14 +156,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2007, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2007, 5, 8)?, "Fête de la Victoire"), @@ -169,14 +176,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Jour de l'an"), ( NaiveDate::from_ymd_res(2008, 5, 1)?, @@ -192,14 +199,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2009, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2009, 5, 8)?, "Fête de la Victoire"), @@ -213,14 +220,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2010, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2010, 5, 8)?, "Fête de la Victoire"), @@ -234,14 +241,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2011, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2011, 5, 8)?, "Fête de la Victoire"), @@ -255,14 +262,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2012, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2012, 5, 8)?, "Fête de la Victoire"), @@ -276,14 +283,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2013, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2013, 5, 8)?, "Fête de la Victoire"), @@ -297,14 +304,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2014, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2014, 5, 8)?, "Fête de la Victoire"), @@ -318,14 +325,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2015, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2015, 5, 8)?, "Fête de la Victoire"), @@ -339,14 +346,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2016, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2016, 5, 8)?, "Fête de la Victoire"), @@ -360,14 +367,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2017, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2017, 5, 8)?, "Fête de la Victoire"), @@ -381,14 +388,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2018, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2018, 5, 8)?, "Fête de la Victoire"), @@ -402,14 +409,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2019, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2019, 5, 8)?, "Fête de la Victoire"), @@ -423,14 +430,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2020, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2020, 5, 8)?, "Fête de la Victoire"), @@ -444,14 +451,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2021, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2021, 5, 8)?, "Fête de la Victoire"), @@ -465,14 +472,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2022, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2022, 5, 8)?, "Fête de la Victoire"), @@ -486,14 +493,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2023, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2023, 5, 8)?, "Fête de la Victoire"), @@ -507,14 +514,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2024, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2024, 5, 8)?, "Fête de la Victoire"), @@ -528,14 +535,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2025, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2025, 5, 8)?, "Fête de la Victoire"), @@ -549,14 +556,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2026, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2026, 5, 8)?, "Fête de la Victoire"), @@ -570,14 +577,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2027, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2027, 5, 8)?, "Fête de la Victoire"), @@ -591,14 +598,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2028, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2028, 5, 8)?, "Fête de la Victoire"), @@ -612,14 +619,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2029, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2029, 5, 8)?, "Fête de la Victoire"), @@ -633,14 +640,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Jour de l'an"), (NaiveDate::from_ymd_res(2030, 5, 1)?, "Fête du Travail"), (NaiveDate::from_ymd_res(2030, 5, 8)?, "Fête de la Victoire"), @@ -654,8 +661,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Noël"), ], &mut map, - Country::FR, - "France", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/gb.rs b/src/data/gb.rs index 84ec560..bf33124 100644 --- a/src/data/gb.rs +++ b/src/data/gb.rs @@ -1,17 +1,24 @@ //! United Kingdom +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "United Kingdom"; +const COUNTY_CODE: Country = Country::GB; + /// Generate holiday map for United Kingdom. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2000, 5, 29)?, "Spring Bank Holiday"), @@ -24,14 +31,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2001, 5, 28)?, "Spring Bank Holiday"), @@ -40,14 +47,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2002, 6, 4)?, "Spring Bank Holiday"), @@ -60,14 +67,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2003, 5, 26)?, "Spring Bank Holiday"), @@ -76,14 +83,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2004, 5, 31)?, "Spring Bank Holiday"), @@ -100,14 +107,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2005, 5, 30)?, "Spring Bank Holiday"), @@ -124,14 +131,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2006, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2006, 5, 29)?, "Spring Bank Holiday"), @@ -144,14 +151,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2007, 5, 28)?, "Spring Bank Holiday"), @@ -160,14 +167,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2008, 5, 26)?, "Spring Bank Holiday"), @@ -176,14 +183,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 5, 4)?, "May Day"), (NaiveDate::from_ymd_res(2009, 5, 25)?, "Spring Bank Holiday"), @@ -196,14 +203,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2010, 5, 31)?, "Spring Bank Holiday"), @@ -220,14 +227,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), (NaiveDate::from_ymd_res(2011, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2011, 5, 30)?, "Spring Bank Holiday"), @@ -248,14 +255,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2012, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2012, 6, 4)?, "Spring Bank Holiday"), @@ -272,14 +279,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2013, 5, 27)?, "Spring Bank Holiday"), @@ -288,14 +295,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2014, 5, 26)?, "Spring Bank Holiday"), @@ -304,14 +311,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 5, 4)?, "May Day"), (NaiveDate::from_ymd_res(2015, 5, 25)?, "Spring Bank Holiday"), @@ -324,14 +331,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2016, 5, 30)?, "Spring Bank Holiday"), @@ -344,14 +351,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2017, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2017, 5, 29)?, "Spring Bank Holiday"), @@ -364,14 +371,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2018, 5, 28)?, "Spring Bank Holiday"), @@ -380,14 +387,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2019, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2019, 5, 27)?, "Spring Bank Holiday"), @@ -396,14 +403,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 5, 8)?, "May Day"), (NaiveDate::from_ymd_res(2020, 5, 25)?, "Spring Bank Holiday"), @@ -416,14 +423,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2021, 5, 31)?, "Spring Bank Holiday"), @@ -440,14 +447,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), (NaiveDate::from_ymd_res(2022, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2022, 6, 2)?, "Spring Bank Holiday"), @@ -472,14 +479,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), (NaiveDate::from_ymd_res(2023, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2023, 5, 29)?, "Spring Bank Holiday"), @@ -496,14 +503,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2024, 5, 27)?, "Spring Bank Holiday"), @@ -512,14 +519,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2025, 5, 26)?, "Spring Bank Holiday"), @@ -528,14 +535,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 5, 4)?, "May Day"), (NaiveDate::from_ymd_res(2026, 5, 25)?, "Spring Bank Holiday"), @@ -548,14 +555,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2027, 5, 31)?, "Spring Bank Holiday"), @@ -572,14 +579,14 @@ pub fn build( ), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2028, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2028, 5, 29)?, "Spring Bank Holiday"), @@ -592,14 +599,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2029, 5, 28)?, "Spring Bank Holiday"), @@ -608,14 +615,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2030, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2030, 5, 27)?, "Spring Bank Holiday"), @@ -624,8 +631,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::GB, - "United Kingdom", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ge.rs b/src/data/ge.rs index 7507b80..48117ae 100644 --- a/src/data/ge.rs +++ b/src/data/ge.rs @@ -1,17 +1,24 @@ //! Georgia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Georgia"; +const COUNTY_CODE: Country = Country::GE; + /// Generate holiday map for Georgia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2000, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2000, 1, 7)?, "ქრისტეშობა"), @@ -43,14 +50,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2001, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2001, 1, 7)?, "ქრისტეშობა"), @@ -82,14 +89,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2002, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2002, 1, 7)?, "ქრისტეშობა"), @@ -121,14 +128,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2003, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2003, 1, 7)?, "ქრისტეშობა"), @@ -160,14 +167,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2004, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2004, 1, 7)?, "ქრისტეშობა"), @@ -198,14 +205,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2005, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2005, 1, 7)?, "ქრისტეშობა"), @@ -237,14 +244,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2006, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2006, 1, 7)?, "ქრისტეშობა"), @@ -276,14 +283,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2007, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2007, 1, 7)?, "ქრისტეშობა"), @@ -314,14 +321,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2008, 1, 7)?, "ქრისტეშობა"), @@ -353,14 +360,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2009, 1, 7)?, "ქრისტეშობა"), @@ -392,14 +399,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2010, 1, 7)?, "ქრისტეშობა"), @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2011, 1, 7)?, "ქრისტეშობა"), @@ -470,14 +477,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2012, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2012, 1, 7)?, "ქრისტეშობა"), @@ -509,14 +516,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2013, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2013, 1, 7)?, "ქრისტეშობა"), @@ -548,14 +555,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2014, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2014, 1, 7)?, "ქრისტეშობა"), @@ -587,14 +594,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2015, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2015, 1, 7)?, "ქრისტეშობა"), @@ -626,14 +633,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2016, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2016, 1, 7)?, "ქრისტეშობა"), @@ -665,14 +672,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2017, 1, 7)?, "ქრისტეშობა"), @@ -704,14 +711,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2018, 1, 7)?, "ქრისტეშობა"), @@ -742,14 +749,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2019, 1, 7)?, "ქრისტეშობა"), @@ -781,14 +788,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2020, 1, 7)?, "ქრისტეშობა"), @@ -820,14 +827,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2021, 1, 7)?, "ქრისტეშობა"), @@ -859,14 +866,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2022, 1, 7)?, "ქრისტეშობა"), @@ -898,14 +905,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2023, 1, 7)?, "ქრისტეშობა"), @@ -937,14 +944,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2024, 1, 7)?, "ქრისტეშობა"), @@ -976,14 +983,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2025, 1, 7)?, "ქრისტეშობა"), @@ -1015,14 +1022,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2026, 1, 7)?, "ქრისტეშობა"), @@ -1054,14 +1061,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2027, 1, 7)?, "ქრისტეშობა"), @@ -1093,14 +1100,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2028, 1, 7)?, "ქრისტეშობა"), @@ -1132,14 +1139,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2029, 1, 7)?, "ქრისტეშობა"), @@ -1170,14 +1177,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "ახალი წელი"), (NaiveDate::from_ymd_res(2030, 1, 7)?, "ქრისტეშობა"), @@ -1209,8 +1216,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 11, 23)?, "გიორგობა"), ], &mut map, - Country::GE, - "Georgia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/gr.rs b/src/data/gr.rs index 100dbc5..20167ac 100644 --- a/src/data/gr.rs +++ b/src/data/gr.rs @@ -1,17 +1,24 @@ //! Greece +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Greece"; +const COUNTY_CODE: Country = Country::GR; + /// Generate holiday map for Greece. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2000, 3, 13)?, "Καθαρά Δευτέρα"), @@ -40,14 +47,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2001, 2, 26)?, "Καθαρά Δευτέρα"), @@ -74,14 +81,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2002, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2002, 3, 18)?, "Καθαρά Δευτέρα"), @@ -108,14 +115,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2003, 3, 10)?, "Καθαρά Δευτέρα"), @@ -142,14 +149,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2004, 2, 23)?, "Καθαρά Δευτέρα"), @@ -176,14 +183,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2005, 3, 14)?, "Καθαρά Δευτέρα"), @@ -210,14 +217,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2006, 3, 6)?, "Καθαρά Δευτέρα"), @@ -244,14 +251,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2007, 2, 19)?, "Καθαρά Δευτέρα"), @@ -278,14 +285,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2008, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2008, 3, 10)?, "Καθαρά Δευτέρα"), @@ -312,14 +319,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2009, 3, 2)?, "Καθαρά Δευτέρα"), @@ -346,14 +353,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2010, 2, 15)?, "Καθαρά Δευτέρα"), @@ -380,14 +387,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2011, 3, 7)?, "Καθαρά Δευτέρα"), @@ -414,14 +421,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2012, 2, 27)?, "Καθαρά Δευτέρα"), @@ -448,14 +455,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2013, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2013, 3, 18)?, "Καθαρά Δευτέρα"), @@ -482,14 +489,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2014, 3, 3)?, "Καθαρά Δευτέρα"), @@ -516,14 +523,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2015, 2, 23)?, "Καθαρά Δευτέρα"), @@ -550,14 +557,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2016, 3, 14)?, "Καθαρά Δευτέρα"), @@ -584,14 +591,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2017, 2, 27)?, "Καθαρά Δευτέρα"), @@ -618,14 +625,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2018, 2, 19)?, "Καθαρά Δευτέρα"), @@ -652,14 +659,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2019, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2019, 3, 11)?, "Καθαρά Δευτέρα"), @@ -686,14 +693,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2020, 3, 2)?, "Καθαρά Δευτέρα"), @@ -720,14 +727,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2021, 3, 15)?, "Καθαρά Δευτέρα"), @@ -758,14 +765,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2022, 3, 7)?, "Καθαρά Δευτέρα"), @@ -796,14 +803,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2023, 2, 27)?, "Καθαρά Δευτέρα"), @@ -830,14 +837,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2024, 3, 18)?, "Καθαρά Δευτέρα"), @@ -864,14 +871,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2025, 3, 3)?, "Καθαρά Δευτέρα"), @@ -898,14 +905,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2026, 2, 23)?, "Καθαρά Δευτέρα"), @@ -932,14 +939,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2027, 3, 15)?, "Καθαρά Δευτέρα"), @@ -970,14 +977,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2028, 2, 28)?, "Καθαρά Δευτέρα"), @@ -1004,14 +1011,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2029, 2, 19)?, "Καθαρά Δευτέρα"), @@ -1038,14 +1045,14 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Πρωτοχρονιά"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Θεοφάνεια"), (NaiveDate::from_ymd_res(2030, 3, 11)?, "Καθαρά Δευτέρα"), @@ -1072,8 +1079,8 @@ pub fn build( ), ], &mut map, - Country::GR, - "Greece", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/helper.rs b/src/data/helper.rs index 1a706a4..f4472ff 100644 --- a/src/data/helper.rs +++ b/src/data/helper.rs @@ -1,18 +1,37 @@ +use std::collections::HashSet; + use chrono::NaiveDate; -use crate::{prelude::*, Holiday, HolidayPerCountryMap, Year}; +use crate::{prelude::*, Holiday, HolidayPerYearMap, Year}; + +pub fn should_build(countries: Option<&HashSet>, country: Country) -> bool { + match countries { + Some(c) => c.contains(&country), + None => true, + } +} + +pub fn add_main_country_from_subdivisions(c: &mut HashSet) { + c.extend( + c.iter() + .copied() + .filter_map(Country::country_from_subdivision) + .collect::>(), + ); +} -pub fn should_build_year(years: &Option<&std::ops::Range>, year: Year) -> bool { +pub fn should_build_year(years: Option<&std::ops::Range>, year: Year) -> bool { years.map_or(true, |r| r.contains(&year)) } +#[allow(clippy::needless_pass_by_value)] pub fn build_year( - years: &Option<&std::ops::Range>, + years: Option<&std::ops::Range>, year: Year, holidays: impl IntoIterator, - map: &mut HolidayPerCountryMap, + map: &mut HolidayPerYearMap, country: Country, - county_name: impl ToString, + county_name: &(impl ToString + ?Sized), ) { if !should_build_year(years, year) { return; diff --git a/src/data/hk.rs b/src/data/hk.rs index 532b67e..583192a 100644 --- a/src/data/hk.rs +++ b/src/data/hk.rs @@ -1,17 +1,24 @@ //! Hong Kong +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Hong Kong"; +const COUNTY_CODE: Country = Country::HK; + /// Generate holiday map for Hong Kong. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 1)?, "The first day of January", @@ -48,14 +55,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 1)?, "The first day of January", @@ -95,14 +102,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 1)?, "The first day of January", @@ -138,14 +145,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 1)?, "The first day of January", @@ -178,14 +185,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 1)?, "The first day of January", @@ -225,14 +232,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 1)?, "The first day of January", @@ -273,14 +280,14 @@ pub fn build( ), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 1)?, "The first day of January", @@ -324,14 +331,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "The first day of January", @@ -371,14 +378,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 1)?, "The first day of January", @@ -415,14 +422,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 1)?, "The first day of January", @@ -458,14 +465,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 1)?, "The first day of January", @@ -501,14 +508,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 1)?, "The first day of January", @@ -549,14 +556,14 @@ pub fn build( ), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 1)?, "The first day of January", @@ -603,14 +610,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 1)?, "The first day of January", @@ -650,14 +657,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 1)?, "The first day of January", @@ -693,39 +700,38 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( - years, - 2015, - vec![ - - (NaiveDate::from_ymd_res(2015, 1, 1)?, "The first day of January"), - (NaiveDate::from_ymd_res(2015, 2, 19)?, "Lunar New Year's Day"), - (NaiveDate::from_ymd_res(2015, 2, 20)?, "The second day of Lunar New Year"), - (NaiveDate::from_ymd_res(2015, 2, 21)?, "The third day of Lunar New Year"), - (NaiveDate::from_ymd_res(2015, 4, 5)?, "Ching Ming Festival"), - (NaiveDate::from_ymd_res(2015, 4, 6)?, "Ching Ming Festival (observed)"), - (NaiveDate::from_ymd_res(2015, 5, 1)?, "Labour Day"), - (NaiveDate::from_ymd_res(2015, 6, 20)?, "Tuen Ng Festival"), - (NaiveDate::from_ymd_res(2015, 7, 1)?, "Hong Kong Special Administrative Region Establishment Day"), - (NaiveDate::from_ymd_res(2015, 9, 28)?, "The day following the Chinese Mid-Autumn Festival"), - (NaiveDate::from_ymd_res(2015, 10, 21)?, "Chung Yeung Festival"), - (NaiveDate::from_ymd_res(2015, 10, 1)?, "National Day"), - (NaiveDate::from_ymd_res(2015, 12, 25)?, "Christmas Day"), - (NaiveDate::from_ymd_res(2015, 9, 3)?, "The 70th anniversary day of the victory of the Chinese people's war of resistance against Japanese aggression"), - ], - &mut map, - Country::HK, - "Hong Kong", - ); + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 1)?, "The first day of January"), + (NaiveDate::from_ymd_res(2015, 2, 19)?, "Lunar New Year's Day"), + (NaiveDate::from_ymd_res(2015, 2, 20)?, "The second day of Lunar New Year"), + (NaiveDate::from_ymd_res(2015, 2, 21)?, "The third day of Lunar New Year"), + (NaiveDate::from_ymd_res(2015, 4, 5)?, "Ching Ming Festival"), + (NaiveDate::from_ymd_res(2015, 4, 6)?, "Ching Ming Festival (observed)"), + (NaiveDate::from_ymd_res(2015, 5, 1)?, "Labour Day"), + (NaiveDate::from_ymd_res(2015, 6, 20)?, "Tuen Ng Festival"), + (NaiveDate::from_ymd_res(2015, 7, 1)?, "Hong Kong Special Administrative Region Establishment Day"), + (NaiveDate::from_ymd_res(2015, 9, 28)?, "The day following the Chinese Mid-Autumn Festival"), + (NaiveDate::from_ymd_res(2015, 10, 21)?, "Chung Yeung Festival"), + (NaiveDate::from_ymd_res(2015, 10, 1)?, "National Day"), + (NaiveDate::from_ymd_res(2015, 12, 25)?, "Christmas Day"), + (NaiveDate::from_ymd_res(2015, 9, 3)?, "The 70th anniversary day of the victory of the Chinese people's war of resistance against Japanese aggression"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 1)?, "The first day of January", @@ -770,14 +776,14 @@ pub fn build( ), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 1)?, "The first day of January", @@ -821,14 +827,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 1)?, "The first day of January", @@ -868,14 +874,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 1)?, "The first day of January", @@ -908,14 +914,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 1)?, "The first day of January", @@ -955,14 +961,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 1)?, "The first day of January", @@ -1002,14 +1008,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 1)?, "The first day of January", @@ -1058,14 +1064,14 @@ pub fn build( ), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 1)?, "The first day of January", @@ -1113,14 +1119,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 1)?, "The first day of January", @@ -1164,14 +1170,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 1)?, "The first day of January", @@ -1219,14 +1225,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 1)?, "The first day of January", @@ -1283,14 +1289,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 1)?, "The first day of January", @@ -1336,14 +1342,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 1)?, "The first day of January", @@ -1397,14 +1403,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 1)?, "The first day of January", @@ -1458,14 +1464,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 1)?, "The first day of January", @@ -1515,8 +1521,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Christmas Day"), ], &mut map, - Country::HK, - "Hong Kong", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/hn.rs b/src/data/hn.rs index 3b3f6e2..3e60a89 100644 --- a/src/data/hn.rs +++ b/src/data/hn.rs @@ -1,17 +1,24 @@ //! Honduras +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Honduras"; +const COUNTY_CODE: Country = Country::HN; + /// Generate holiday map for Honduras. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2000, 4, 20)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Viernes Santo"), @@ -31,14 +38,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2001, 4, 12)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Viernes Santo"), @@ -60,14 +67,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2002, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Viernes Santo"), @@ -87,14 +94,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2003, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Viernes Santo"), @@ -114,14 +121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2004, 4, 8)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Viernes Santo"), @@ -141,14 +148,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2005, 3, 24)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Viernes Santo"), @@ -168,14 +175,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2006, 4, 13)?, "Jueves Santo"), ( @@ -197,14 +204,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2007, 4, 5)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Viernes Santo"), @@ -224,14 +231,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2008, 3, 20)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Viernes Santo"), @@ -251,14 +258,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2009, 4, 9)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Viernes Santo"), @@ -278,14 +285,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2010, 4, 1)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Viernes Santo"), @@ -305,14 +312,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2011, 4, 21)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Viernes Santo"), @@ -332,14 +339,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2012, 4, 5)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Viernes Santo"), @@ -359,14 +366,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2013, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Viernes Santo"), @@ -386,14 +393,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2014, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Viernes Santo"), @@ -413,14 +420,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2015, 4, 2)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Viernes Santo"), @@ -437,14 +444,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2016, 3, 24)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Viernes Santo"), @@ -461,14 +468,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2017, 4, 13)?, "Jueves Santo"), ( @@ -487,14 +494,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2018, 3, 29)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Viernes Santo"), @@ -511,14 +518,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2019, 4, 18)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Viernes Santo"), @@ -535,14 +542,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2020, 4, 9)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Viernes Santo"), @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2021, 4, 1)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Viernes Santo"), @@ -583,14 +590,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2022, 4, 14)?, @@ -609,14 +616,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2023, 4, 6)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Viernes Santo"), @@ -633,14 +640,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2024, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Viernes Santo"), @@ -657,14 +664,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2025, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Viernes Santo"), @@ -681,14 +688,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2026, 4, 2)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Viernes Santo"), @@ -705,14 +712,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2027, 3, 25)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Viernes Santo"), @@ -729,14 +736,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2028, 4, 13)?, "Jueves Santo"), ( @@ -755,14 +762,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2029, 3, 29)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Viernes Santo"), @@ -779,14 +786,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2030, 4, 18)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Viernes Santo"), @@ -803,8 +810,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Navidad"), ], &mut map, - Country::HN, - "Honduras", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/hr.rs b/src/data/hr.rs index d5c1f65..329c4f4 100644 --- a/src/data/hr.rs +++ b/src/data/hr.rs @@ -1,17 +1,24 @@ //! Croatia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Croatia"; +const COUNTY_CODE: Country = Country::HR; + /// Generate holiday map for Croatia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2000, 1, 6)?, @@ -34,14 +41,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2001, 1, 6)?, @@ -64,14 +71,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Nova godina"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Uskrsni ponedjeljak"), (NaiveDate::from_ymd_res(2002, 5, 30)?, "Tijelovo"), @@ -92,14 +99,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2003, 1, 6)?, @@ -124,14 +131,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2004, 1, 6)?, @@ -156,14 +163,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2005, 1, 6)?, @@ -188,14 +195,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2006, 1, 6)?, @@ -220,14 +227,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2007, 1, 6)?, @@ -252,14 +259,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2008, 1, 6)?, @@ -284,14 +291,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2009, 1, 6)?, @@ -317,14 +324,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2010, 1, 6)?, @@ -350,14 +357,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2011, 1, 6)?, @@ -383,14 +390,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2012, 1, 6)?, @@ -416,14 +423,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2013, 1, 6)?, @@ -449,14 +456,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2014, 1, 6)?, @@ -482,14 +489,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2015, 1, 6)?, @@ -515,14 +522,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2016, 1, 6)?, @@ -548,14 +555,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2017, 1, 6)?, @@ -581,14 +588,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2018, 1, 6)?, @@ -614,14 +621,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Nova godina"), ( NaiveDate::from_ymd_res(2019, 1, 6)?, @@ -647,283 +654,272 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Sveti Stjepan"), ], &mut map, - Country::HR, - "Croatia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( - years, - 2020, - vec![ - - (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2020, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2020, 4, 12)?, "Uskrs"), - (NaiveDate::from_ymd_res(2020, 4, 13)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2020, 6, 11)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2020, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2020, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2020, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2020, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2020, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2020, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2020, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2020, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2020, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2020, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2020, 4, 12)?, "Uskrs"), + (NaiveDate::from_ymd_res(2020, 4, 13)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2020, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2020, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2020, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2020, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2020, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2020, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2020, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2020, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2021, - vec![ - - (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2021, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2021, 4, 4)?, "Uskrs"), - (NaiveDate::from_ymd_res(2021, 4, 5)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2021, 6, 3)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2021, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2021, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2021, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2021, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2021, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2021, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2021, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2021, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2021, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2021, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2021, 4, 4)?, "Uskrs"), + (NaiveDate::from_ymd_res(2021, 4, 5)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2021, 6, 3)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2021, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2021, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2021, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2021, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2021, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2021, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2021, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2021, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2022, - vec![ - - (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2022, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2022, 4, 17)?, "Uskrs"), - (NaiveDate::from_ymd_res(2022, 4, 18)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2022, 6, 16)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2022, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2022, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2022, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2022, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2022, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2022, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2022, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2022, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2022, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2022, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2022, 4, 17)?, "Uskrs"), + (NaiveDate::from_ymd_res(2022, 4, 18)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2022, 6, 16)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2022, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2022, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2022, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2022, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2022, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2022, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2022, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2022, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2023, - vec![ - - (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2023, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2023, 4, 9)?, "Uskrs"), - (NaiveDate::from_ymd_res(2023, 4, 10)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2023, 6, 8)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2023, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2023, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2023, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2023, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2023, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2023, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2023, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2023, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2023, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2023, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2023, 4, 9)?, "Uskrs"), + (NaiveDate::from_ymd_res(2023, 4, 10)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2023, 6, 8)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2023, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2023, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2023, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2023, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2023, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2023, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2023, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2023, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2024, - vec![ - - (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2024, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2024, 3, 31)?, "Uskrs"), - (NaiveDate::from_ymd_res(2024, 4, 1)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2024, 5, 30)?, "Dan državnosti; Tijelovo"), - (NaiveDate::from_ymd_res(2024, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2024, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2024, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2024, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2024, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2024, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2024, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2024, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2024, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2024, 3, 31)?, "Uskrs"), + (NaiveDate::from_ymd_res(2024, 4, 1)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2024, 5, 30)?, "Dan državnosti; Tijelovo"), + (NaiveDate::from_ymd_res(2024, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2024, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2024, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2024, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2024, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2024, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2024, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2025, - vec![ - - (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2025, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2025, 4, 20)?, "Uskrs"), - (NaiveDate::from_ymd_res(2025, 4, 21)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2025, 6, 19)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2025, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2025, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2025, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2025, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2025, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2025, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2025, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2025, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2025, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2025, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2025, 4, 20)?, "Uskrs"), + (NaiveDate::from_ymd_res(2025, 4, 21)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2025, 6, 19)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2025, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2025, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2025, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2025, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2025, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2025, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2025, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2025, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2026, - vec![ - - (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2026, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2026, 4, 5)?, "Uskrs"), - (NaiveDate::from_ymd_res(2026, 4, 6)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2026, 6, 4)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2026, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2026, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2026, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2026, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2026, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2026, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2026, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2026, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2026, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2026, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2026, 4, 5)?, "Uskrs"), + (NaiveDate::from_ymd_res(2026, 4, 6)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2026, 6, 4)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2026, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2026, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2026, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2026, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2026, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2026, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2026, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2026, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2027, - vec![ - - (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2027, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2027, 3, 28)?, "Uskrs"), - (NaiveDate::from_ymd_res(2027, 3, 29)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2027, 5, 27)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2027, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2027, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2027, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2027, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2027, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2027, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2027, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2027, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2027, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2027, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2027, 3, 28)?, "Uskrs"), + (NaiveDate::from_ymd_res(2027, 3, 29)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2027, 5, 27)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2027, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2027, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2027, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2027, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2027, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2027, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2027, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2027, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2028, - vec![ - - (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2028, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2028, 4, 16)?, "Uskrs"), - (NaiveDate::from_ymd_res(2028, 4, 17)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2028, 6, 15)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2028, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2028, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2028, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2028, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2028, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2028, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2028, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2028, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2028, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2028, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2028, 4, 16)?, "Uskrs"), + (NaiveDate::from_ymd_res(2028, 4, 17)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2028, 6, 15)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2028, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2028, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2028, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2028, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2028, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2028, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2028, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2028, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2029, - vec![ - - (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2029, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2029, 4, 1)?, "Uskrs"), - (NaiveDate::from_ymd_res(2029, 4, 2)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2029, 5, 31)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2029, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2029, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2029, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2029, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2029, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2029, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2029, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2029, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2029, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2029, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2029, 4, 1)?, "Uskrs"), + (NaiveDate::from_ymd_res(2029, 4, 2)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2029, 5, 31)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2029, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2029, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2029, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2029, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2029, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2029, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2029, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2029, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2030, - vec![ - - (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nova godina"), - (NaiveDate::from_ymd_res(2030, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), - (NaiveDate::from_ymd_res(2030, 4, 21)?, "Uskrs"), - (NaiveDate::from_ymd_res(2030, 4, 22)?, "Uskrsni ponedjeljak"), - (NaiveDate::from_ymd_res(2030, 6, 20)?, "Tijelovo"), - (NaiveDate::from_ymd_res(2030, 5, 1)?, "Praznik rada"), - (NaiveDate::from_ymd_res(2030, 5, 30)?, "Dan državnosti"), - (NaiveDate::from_ymd_res(2030, 6, 22)?, "Dan antifašističke borbe"), - (NaiveDate::from_ymd_res(2030, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), - (NaiveDate::from_ymd_res(2030, 8, 15)?, "Velika Gospa"), - (NaiveDate::from_ymd_res(2030, 11, 1)?, "Svi sveti"), - (NaiveDate::from_ymd_res(2030, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), - (NaiveDate::from_ymd_res(2030, 12, 25)?, "Božić"), - (NaiveDate::from_ymd_res(2030, 12, 26)?, "Sveti Stjepan"), - ], - &mut map, - Country::HR, - "Croatia", - ); + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nova godina"), + (NaiveDate::from_ymd_res(2030, 1, 6)?, "Bogojavljenje ili Sveta tri kralja"), + (NaiveDate::from_ymd_res(2030, 4, 21)?, "Uskrs"), + (NaiveDate::from_ymd_res(2030, 4, 22)?, "Uskrsni ponedjeljak"), + (NaiveDate::from_ymd_res(2030, 6, 20)?, "Tijelovo"), + (NaiveDate::from_ymd_res(2030, 5, 1)?, "Praznik rada"), + (NaiveDate::from_ymd_res(2030, 5, 30)?, "Dan državnosti"), + (NaiveDate::from_ymd_res(2030, 6, 22)?, "Dan antifašističke borbe"), + (NaiveDate::from_ymd_res(2030, 8, 5)?, "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), + (NaiveDate::from_ymd_res(2030, 8, 15)?, "Velika Gospa"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Svi sveti"), + (NaiveDate::from_ymd_res(2030, 11, 18)?, "Dan sjećanja na žrtve Domovinskog rata i Dan sjećanja na žrtvu Vukovara i Škabrnje"), + (NaiveDate::from_ymd_res(2030, 12, 25)?, "Božić"), + (NaiveDate::from_ymd_res(2030, 12, 26)?, "Sveti Stjepan"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); Ok(map) } diff --git a/src/data/hu.rs b/src/data/hu.rs index c998f0d..cf7eebf 100644 --- a/src/data/hu.rs +++ b/src/data/hu.rs @@ -1,17 +1,24 @@ //! Hungary +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Hungary"; +const COUNTY_CODE: Country = Country::HU; + /// Generate holiday map for Hungary. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2000, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2000, 4, 23)?, "Húsvét"), @@ -29,14 +36,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2001, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2001, 4, 15)?, "Húsvét"), @@ -54,14 +61,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2002, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2002, 3, 31)?, "Húsvét"), @@ -79,14 +86,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2003, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2003, 4, 20)?, "Húsvét"), @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2004, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2004, 4, 11)?, "Húsvét"), @@ -129,14 +136,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2005, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2005, 3, 27)?, "Húsvét"), @@ -154,14 +161,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2006, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2006, 4, 16)?, "Húsvét"), @@ -179,14 +186,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2007, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2007, 4, 8)?, "Húsvét"), @@ -204,14 +211,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2008, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2008, 3, 23)?, "Húsvét"), @@ -229,14 +236,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2009, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2009, 4, 12)?, "Húsvét"), @@ -254,14 +261,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2010, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2010, 4, 4)?, "Húsvét"), @@ -283,14 +290,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2011, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2011, 4, 24)?, "Húsvét"), @@ -316,14 +323,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2012, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2012, 4, 8)?, "Húsvét"), @@ -365,14 +372,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2013, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2013, 3, 31)?, "Húsvét"), @@ -402,14 +409,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2014, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2014, 4, 20)?, "Húsvét"), @@ -439,14 +446,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2015, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2015, 4, 5)?, "Húsvét"), @@ -476,14 +483,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2016, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2016, 3, 27)?, "Húsvét"), @@ -509,14 +516,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2017, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Nagypéntek"), @@ -535,14 +542,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2018, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Nagypéntek"), @@ -585,14 +592,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2019, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Nagypéntek"), @@ -623,14 +630,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2020, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Nagypéntek"), @@ -657,14 +664,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2021, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Nagypéntek"), @@ -687,14 +694,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2022, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Nagypéntek"), @@ -721,14 +728,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2023, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Nagypéntek"), @@ -747,14 +754,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2024, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Nagypéntek"), @@ -785,14 +792,14 @@ pub fn build( ), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2025, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Nagypéntek"), @@ -811,14 +818,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2026, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Nagypéntek"), @@ -837,14 +844,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2027, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Nagypéntek"), @@ -863,14 +870,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2028, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Nagypéntek"), @@ -889,14 +896,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2029, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Nagypéntek"), @@ -915,14 +922,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Újév"), (NaiveDate::from_ymd_res(2030, 3, 15)?, "Nemzeti ünnep"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Nagypéntek"), @@ -941,8 +948,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Karácsony másnapja"), ], &mut map, - Country::HU, - "Hungary", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/id.rs b/src/data/id.rs index 748b340..5fe4808 100644 --- a/src/data/id.rs +++ b/src/data/id.rs @@ -1,17 +1,24 @@ //! Indonesia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Indonesia"; +const COUNTY_CODE: Country = Country::ID; + /// Generate holiday map for Indonesia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Wafat Yesus Kristus"), ( @@ -61,14 +68,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Wafat Yesus Kristus"), ( @@ -104,14 +111,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Wafat Yesus Kristus"), ( @@ -144,14 +151,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2003, 2, 1)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Wafat Yesus Kristus"), @@ -188,14 +195,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2004, 1, 22)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Wafat Yesus Kristus"), @@ -232,14 +239,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2005, 2, 9)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Wafat Yesus Kristus"), @@ -273,14 +280,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2006, 1, 30)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Wafat Yesus Kristus"), @@ -318,14 +325,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2007, 2, 19)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Wafat Yesus Kristus"), @@ -359,14 +366,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2008, 2, 7)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Wafat Yesus Kristus"), @@ -398,14 +405,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2009, 1, 26)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2009, 3, 26)?, "Hari Suci Nyepi"), @@ -434,14 +441,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2010, 2, 15)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2010, 3, 16)?, "Hari Suci Nyepi"), @@ -473,14 +480,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2011, 2, 3)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2011, 3, 5)?, "Hari Suci Nyepi"), @@ -512,14 +519,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2012, 1, 23)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2012, 3, 23)?, "Hari Suci Nyepi"), @@ -548,14 +555,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2013, 2, 11)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2013, 3, 12)?, "Hari Suci Nyepi"), @@ -587,14 +594,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2014, 1, 31)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2014, 3, 31)?, "Hari Suci Nyepi"), @@ -630,14 +637,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2015, 2, 19)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2015, 3, 21)?, "Hari Suci Nyepi"), @@ -674,14 +681,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2016, 3, 9)?, "Hari Suci Nyepi"), @@ -718,14 +725,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2017, 1, 28)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2017, 3, 28)?, "Hari Suci Nyepi"), @@ -762,14 +769,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2018, 2, 16)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2018, 3, 17)?, "Hari Suci Nyepi"), @@ -807,14 +814,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 6, 27)?, "Hari Pemilihan"), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2019, 2, 5)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2019, 3, 7)?, "Hari Suci Nyepi"), @@ -852,14 +859,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 4, 17)?, "Hari Pemilihan"), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2020, 1, 25)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2020, 3, 25)?, "Hari Suci Nyepi"), @@ -897,14 +904,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 9)?, "Hari Pemilihan"), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2021, 2, 12)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2021, 3, 14)?, "Hari Suci Nyepi"), @@ -940,14 +947,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2022, 2, 1)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2022, 3, 3)?, "Hari Suci Nyepi"), @@ -984,14 +991,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Tahun Baru Masehi"), (NaiveDate::from_ymd_res(2023, 1, 22)?, "Tahun Baru Imlek"), (NaiveDate::from_ymd_res(2023, 3, 22)?, "Hari Suci Nyepi"), @@ -1028,14 +1035,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Tahun Baru Masehi"), ( NaiveDate::from_ymd_res(2024, 2, 10)?, @@ -1084,14 +1091,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Tahun Baru Masehi"), ( NaiveDate::from_ymd_res(2025, 1, 29)?, @@ -1143,14 +1150,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Tahun Baru Masehi"), ( NaiveDate::from_ymd_res(2026, 2, 17)?, @@ -1202,14 +1209,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Tahun Baru Masehi"), ( NaiveDate::from_ymd_res(2027, 2, 6)?, @@ -1263,14 +1270,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Tahun Baru Masehi"), ( NaiveDate::from_ymd_res(2028, 1, 26)?, @@ -1317,14 +1324,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Tahun Baru Masehi"), ( NaiveDate::from_ymd_res(2029, 2, 13)?, @@ -1375,14 +1382,14 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Tahun Baru Masehi"), ( NaiveDate::from_ymd_res(2030, 2, 3)?, @@ -1433,8 +1440,8 @@ pub fn build( ), ], &mut map, - Country::ID, - "Indonesia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ie.rs b/src/data/ie.rs index 0f2b877..9592ab1 100644 --- a/src/data/ie.rs +++ b/src/data/ie.rs @@ -1,17 +1,24 @@ //! Ireland +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Ireland"; +const COUNTY_CODE: Country = Country::IE; + /// Generate holiday map for Ireland. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Easter Monday"), @@ -26,14 +33,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Easter Monday"), @@ -48,14 +55,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Easter Monday"), @@ -70,14 +77,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Easter Monday"), @@ -92,14 +99,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Easter Monday"), @@ -114,14 +121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Easter Monday"), @@ -136,14 +143,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2006, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Easter Monday"), @@ -158,14 +165,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Easter Monday"), @@ -180,14 +187,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Easter Monday"), @@ -202,14 +209,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Easter Monday"), @@ -224,14 +231,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Easter Monday"), @@ -246,14 +253,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Easter Monday"), @@ -272,14 +279,14 @@ pub fn build( ), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2012, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Easter Monday"), @@ -294,14 +301,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Easter Monday"), @@ -316,14 +323,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Easter Monday"), @@ -338,14 +345,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Easter Monday"), @@ -360,14 +367,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Easter Monday"), @@ -382,14 +389,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2017, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Easter Monday"), @@ -404,14 +411,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Easter Monday"), @@ -426,14 +433,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Easter Monday"), @@ -448,14 +455,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Easter Monday"), @@ -470,14 +477,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Easter Monday"), @@ -492,14 +499,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 3, 17)?, "St. Patrick's Day"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Easter Monday"), @@ -518,14 +525,14 @@ pub fn build( ), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2023, 2, 6)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2023, 3, 17)?, "St. Patrick's Day"), @@ -541,14 +548,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 2, 5)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2024, 3, 17)?, "St. Patrick's Day"), @@ -564,14 +571,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 2, 3)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2025, 3, 17)?, "St. Patrick's Day"), @@ -587,14 +594,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 2, 2)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2026, 3, 17)?, "St. Patrick's Day"), @@ -610,14 +617,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 2, 1)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2027, 3, 17)?, "St. Patrick's Day"), @@ -633,14 +640,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 2, 7)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2028, 3, 17)?, "St. Patrick's Day"), @@ -656,14 +663,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 2, 5)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2029, 3, 17)?, "St. Patrick's Day"), @@ -679,14 +686,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 2, 1)?, "St. Brigid's Day"), (NaiveDate::from_ymd_res(2030, 3, 17)?, "St. Patrick's Day"), @@ -702,8 +709,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "St. Stephen's Day"), ], &mut map, - Country::IE, - "Ireland", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/il.rs b/src/data/il.rs index 4237432..30724fd 100644 --- a/src/data/il.rs +++ b/src/data/il.rs @@ -1,17 +1,24 @@ //! Israel +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Israel"; +const COUNTY_CODE: Country = Country::IL; + /// Generate holiday map for Israel. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 9, 30)?, "ראש השנה"), (NaiveDate::from_ymd_res(2000, 10, 1)?, "ראש השנה"), (NaiveDate::from_ymd_res(2000, 10, 9)?, "יום כיפור"), @@ -26,14 +33,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 6, 9)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 9, 18)?, "ראש השנה"), (NaiveDate::from_ymd_res(2001, 9, 19)?, "ראש השנה"), (NaiveDate::from_ymd_res(2001, 9, 27)?, "יום כיפור"), @@ -48,14 +55,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 5, 28)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 9, 7)?, "ראש השנה"), (NaiveDate::from_ymd_res(2002, 9, 8)?, "ראש השנה"), (NaiveDate::from_ymd_res(2002, 9, 16)?, "יום כיפור"), @@ -70,14 +77,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 5, 17)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 9, 27)?, "ראש השנה"), (NaiveDate::from_ymd_res(2003, 9, 28)?, "ראש השנה"), (NaiveDate::from_ymd_res(2003, 10, 6)?, "יום כיפור"), @@ -92,14 +99,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 6, 6)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 9, 16)?, "ראש השנה"), (NaiveDate::from_ymd_res(2004, 9, 17)?, "ראש השנה"), (NaiveDate::from_ymd_res(2004, 9, 25)?, "יום כיפור"), @@ -114,14 +121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 5, 26)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 10, 4)?, "ראש השנה"), (NaiveDate::from_ymd_res(2005, 10, 5)?, "ראש השנה"), (NaiveDate::from_ymd_res(2005, 10, 13)?, "יום כיפור"), @@ -136,14 +143,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 6, 13)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 9, 23)?, "ראש השנה"), (NaiveDate::from_ymd_res(2006, 9, 24)?, "ראש השנה"), (NaiveDate::from_ymd_res(2006, 10, 2)?, "יום כיפור"), @@ -158,14 +165,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 6, 2)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 9, 13)?, "ראש השנה"), (NaiveDate::from_ymd_res(2007, 9, 14)?, "ראש השנה"), (NaiveDate::from_ymd_res(2007, 9, 22)?, "יום כיפור"), @@ -180,14 +187,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 5, 23)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 9, 30)?, "ראש השנה"), (NaiveDate::from_ymd_res(2008, 10, 1)?, "ראש השנה"), (NaiveDate::from_ymd_res(2008, 10, 9)?, "יום כיפור"), @@ -202,14 +209,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 6, 9)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 9, 19)?, "ראש השנה"), (NaiveDate::from_ymd_res(2009, 9, 20)?, "ראש השנה"), (NaiveDate::from_ymd_res(2009, 9, 28)?, "יום כיפור"), @@ -224,14 +231,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 5, 29)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 9, 9)?, "ראש השנה"), (NaiveDate::from_ymd_res(2010, 9, 10)?, "ראש השנה"), (NaiveDate::from_ymd_res(2010, 9, 18)?, "יום כיפור"), @@ -246,14 +253,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 5, 19)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 9, 29)?, "ראש השנה"), (NaiveDate::from_ymd_res(2011, 9, 30)?, "ראש השנה"), (NaiveDate::from_ymd_res(2011, 10, 8)?, "יום כיפור"), @@ -268,14 +275,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 6, 8)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 9, 17)?, "ראש השנה"), (NaiveDate::from_ymd_res(2012, 9, 18)?, "ראש השנה"), (NaiveDate::from_ymd_res(2012, 9, 26)?, "יום כיפור"), @@ -290,14 +297,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 5, 27)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 9, 5)?, "ראש השנה"), (NaiveDate::from_ymd_res(2013, 9, 6)?, "ראש השנה"), (NaiveDate::from_ymd_res(2013, 9, 14)?, "יום כיפור"), @@ -312,14 +319,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 5, 15)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 9, 25)?, "ראש השנה"), (NaiveDate::from_ymd_res(2014, 9, 26)?, "ראש השנה"), (NaiveDate::from_ymd_res(2014, 10, 4)?, "יום כיפור"), @@ -334,14 +341,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 6, 4)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 9, 14)?, "ראש השנה"), (NaiveDate::from_ymd_res(2015, 9, 15)?, "ראש השנה"), (NaiveDate::from_ymd_res(2015, 9, 23)?, "יום כיפור"), @@ -356,14 +363,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 5, 24)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 10, 3)?, "ראש השנה"), (NaiveDate::from_ymd_res(2016, 10, 4)?, "ראש השנה"), (NaiveDate::from_ymd_res(2016, 10, 12)?, "יום כיפור"), @@ -378,14 +385,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 6, 12)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 9, 21)?, "ראש השנה"), (NaiveDate::from_ymd_res(2017, 9, 22)?, "ראש השנה"), (NaiveDate::from_ymd_res(2017, 9, 30)?, "יום כיפור"), @@ -400,14 +407,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 5, 31)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 9, 10)?, "ראש השנה"), (NaiveDate::from_ymd_res(2018, 9, 11)?, "ראש השנה"), (NaiveDate::from_ymd_res(2018, 9, 19)?, "יום כיפור"), @@ -422,14 +429,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 5, 20)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 9, 30)?, "ראש השנה"), (NaiveDate::from_ymd_res(2019, 10, 1)?, "ראש השנה"), (NaiveDate::from_ymd_res(2019, 10, 9)?, "יום כיפור"), @@ -444,14 +451,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 6, 9)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 9, 19)?, "ראש השנה"), (NaiveDate::from_ymd_res(2020, 9, 20)?, "ראש השנה"), (NaiveDate::from_ymd_res(2020, 9, 28)?, "יום כיפור"), @@ -466,14 +473,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 5, 29)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 9, 7)?, "ראש השנה"), (NaiveDate::from_ymd_res(2021, 9, 8)?, "ראש השנה"), (NaiveDate::from_ymd_res(2021, 9, 16)?, "יום כיפור"), @@ -488,14 +495,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 5, 17)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 9, 26)?, "ראש השנה"), (NaiveDate::from_ymd_res(2022, 9, 27)?, "ראש השנה"), (NaiveDate::from_ymd_res(2022, 10, 5)?, "יום כיפור"), @@ -510,14 +517,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 6, 5)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 9, 16)?, "ראש השנה"), (NaiveDate::from_ymd_res(2023, 9, 17)?, "ראש השנה"), (NaiveDate::from_ymd_res(2023, 9, 25)?, "יום כיפור"), @@ -532,14 +539,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 5, 26)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 10, 3)?, "ראש השנה"), (NaiveDate::from_ymd_res(2024, 10, 4)?, "ראש השנה"), (NaiveDate::from_ymd_res(2024, 10, 12)?, "יום כיפור"), @@ -554,14 +561,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 6, 12)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 9, 23)?, "ראש השנה"), (NaiveDate::from_ymd_res(2025, 9, 24)?, "ראש השנה"), (NaiveDate::from_ymd_res(2025, 10, 2)?, "יום כיפור"), @@ -576,14 +583,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 6, 2)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 9, 12)?, "ראש השנה"), (NaiveDate::from_ymd_res(2026, 9, 13)?, "ראש השנה"), (NaiveDate::from_ymd_res(2026, 9, 21)?, "יום כיפור"), @@ -598,14 +605,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 5, 22)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 10, 2)?, "ראש השנה"), (NaiveDate::from_ymd_res(2027, 10, 3)?, "ראש השנה"), (NaiveDate::from_ymd_res(2027, 10, 11)?, "יום כיפור"), @@ -620,14 +627,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 6, 11)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 9, 21)?, "ראש השנה"), (NaiveDate::from_ymd_res(2028, 9, 22)?, "ראש השנה"), (NaiveDate::from_ymd_res(2028, 9, 30)?, "יום כיפור"), @@ -642,14 +649,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 5, 31)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 9, 10)?, "ראש השנה"), (NaiveDate::from_ymd_res(2029, 9, 11)?, "ראש השנה"), (NaiveDate::from_ymd_res(2029, 9, 19)?, "יום כיפור"), @@ -664,14 +671,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 5, 20)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 9, 28)?, "ראש השנה"), (NaiveDate::from_ymd_res(2030, 9, 29)?, "ראש השנה"), (NaiveDate::from_ymd_res(2030, 10, 7)?, "יום כיפור"), @@ -686,8 +693,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 6, 7)?, "שבועות"), ], &mut map, - Country::IL, - "Israel", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/im.rs b/src/data/im.rs index 5966b81..7cc8925 100644 --- a/src/data/im.rs +++ b/src/data/im.rs @@ -1,17 +1,24 @@ //! Isle of Man +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Isle of Man"; +const COUNTY_CODE: Country = Country::IM; + /// Generate holiday map for Isle of Man. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2000, 5, 29)?, "Spring Bank Holiday"), @@ -31,14 +38,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2001, 5, 28)?, "Spring Bank Holiday"), @@ -54,14 +61,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2002, 6, 4)?, "Spring Bank Holiday"), @@ -81,14 +88,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2003, 5, 26)?, "Spring Bank Holiday"), @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2004, 5, 31)?, "Spring Bank Holiday"), @@ -135,14 +142,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2005, 5, 30)?, "Spring Bank Holiday"), @@ -166,14 +173,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2006, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2006, 5, 29)?, "Spring Bank Holiday"), @@ -193,14 +200,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2007, 5, 28)?, "Spring Bank Holiday"), @@ -216,14 +223,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2008, 5, 26)?, "Spring Bank Holiday"), @@ -239,14 +246,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 5, 4)?, "May Day"), (NaiveDate::from_ymd_res(2009, 5, 25)?, "Spring Bank Holiday"), @@ -266,14 +273,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2010, 5, 31)?, "Spring Bank Holiday"), @@ -297,14 +304,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), (NaiveDate::from_ymd_res(2011, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2011, 5, 30)?, "Spring Bank Holiday"), @@ -332,14 +339,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2012, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2012, 6, 4)?, "Spring Bank Holiday"), @@ -363,14 +370,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2013, 5, 27)?, "Spring Bank Holiday"), @@ -386,14 +393,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2014, 5, 26)?, "Spring Bank Holiday"), @@ -409,14 +416,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 5, 4)?, "May Day"), (NaiveDate::from_ymd_res(2015, 5, 25)?, "Spring Bank Holiday"), @@ -436,14 +443,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2016, 5, 30)?, "Spring Bank Holiday"), @@ -463,14 +470,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2017, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2017, 5, 29)?, "Spring Bank Holiday"), @@ -490,14 +497,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2018, 5, 28)?, "Spring Bank Holiday"), @@ -513,14 +520,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2019, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2019, 5, 27)?, "Spring Bank Holiday"), @@ -536,14 +543,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 5, 8)?, "May Day"), (NaiveDate::from_ymd_res(2020, 5, 25)?, "Spring Bank Holiday"), @@ -563,14 +570,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2021, 5, 31)?, "Spring Bank Holiday"), @@ -594,14 +601,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), (NaiveDate::from_ymd_res(2022, 5, 2)?, "May Day"), (NaiveDate::from_ymd_res(2022, 6, 2)?, "Spring Bank Holiday"), @@ -632,14 +639,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), (NaiveDate::from_ymd_res(2023, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2023, 5, 29)?, "Spring Bank Holiday"), @@ -663,14 +670,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2024, 5, 27)?, "Spring Bank Holiday"), @@ -686,14 +693,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 5, 5)?, "May Day"), (NaiveDate::from_ymd_res(2025, 5, 26)?, "Spring Bank Holiday"), @@ -709,14 +716,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 5, 4)?, "May Day"), (NaiveDate::from_ymd_res(2026, 5, 25)?, "Spring Bank Holiday"), @@ -736,14 +743,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 5, 3)?, "May Day"), (NaiveDate::from_ymd_res(2027, 5, 31)?, "Spring Bank Holiday"), @@ -767,14 +774,14 @@ pub fn build( ), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2028, 5, 1)?, "May Day"), (NaiveDate::from_ymd_res(2028, 5, 29)?, "Spring Bank Holiday"), @@ -794,14 +801,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 5, 7)?, "May Day"), (NaiveDate::from_ymd_res(2029, 5, 28)?, "Spring Bank Holiday"), @@ -817,14 +824,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2030, 5, 6)?, "May Day"), (NaiveDate::from_ymd_res(2030, 5, 27)?, "Spring Bank Holiday"), @@ -840,8 +847,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::IM, - "Isle of Man", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/in.rs b/src/data/in.rs index 21751e2..fd2a716 100644 --- a/src/data/in.rs +++ b/src/data/in.rs @@ -1,17 +1,24 @@ //! India +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "India"; +const COUNTY_CODE: Country = Country::IN; + /// Generate holiday map for India. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 14)?, "Makar Sankranti / Pongal", @@ -56,14 +63,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 14)?, "Makar Sankranti / Pongal", @@ -102,14 +109,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 14)?, "Makar Sankranti / Pongal", @@ -146,14 +153,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 14)?, "Makar Sankranti / Pongal", @@ -192,14 +199,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 14)?, "Makar Sankranti / Pongal", @@ -240,14 +247,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 14)?, "Makar Sankranti / Pongal", @@ -286,14 +293,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 14)?, "Makar Sankranti / Pongal", @@ -336,14 +343,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 14)?, "Makar Sankranti / Pongal", @@ -386,14 +393,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 14)?, "Makar Sankranti / Pongal", @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 14)?, "Makar Sankranti / Pongal", @@ -481,14 +488,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 14)?, "Makar Sankranti / Pongal", @@ -527,14 +534,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 14)?, "Makar Sankranti / Pongal", @@ -573,14 +580,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 14)?, "Makar Sankranti / Pongal", @@ -619,14 +626,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 14)?, "Makar Sankranti / Pongal", @@ -665,14 +672,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 14)?, "Makar Sankranti / Pongal", @@ -711,14 +718,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 1, 14)?, "Makar Sankranti / Pongal", @@ -758,14 +765,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 14)?, "Makar Sankranti / Pongal", @@ -804,14 +811,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 14)?, "Makar Sankranti / Pongal", @@ -850,14 +857,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 14)?, "Makar Sankranti / Pongal", @@ -896,14 +903,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 14)?, "Makar Sankranti / Pongal", @@ -942,14 +949,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 14)?, "Makar Sankranti / Pongal", @@ -988,14 +995,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 14)?, "Makar Sankranti / Pongal", @@ -1034,14 +1041,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 14)?, "Makar Sankranti / Pongal", @@ -1080,14 +1087,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 14)?, "Makar Sankranti / Pongal", @@ -1126,14 +1133,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 14)?, "Makar Sankranti / Pongal", @@ -1172,14 +1179,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 14)?, "Makar Sankranti / Pongal", @@ -1218,14 +1225,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 14)?, "Makar Sankranti / Pongal", @@ -1264,14 +1271,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 14)?, "Makar Sankranti / Pongal", @@ -1309,14 +1316,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 14)?, "Makar Sankranti / Pongal", @@ -1355,14 +1362,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 14)?, "Makar Sankranti / Pongal", @@ -1401,14 +1408,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 14)?, "Makar Sankranti / Pongal", @@ -1446,8 +1453,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Christmas Day"), ], &mut map, - Country::IN, - "India", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/is.rs b/src/data/is.rs index 218c772..93db4ac 100644 --- a/src/data/is.rs +++ b/src/data/is.rs @@ -1,17 +1,24 @@ //! Iceland +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Iceland"; +const COUNTY_CODE: Country = Country::IS; + /// Generate holiday map for Iceland. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Nýársdagur"), ( NaiveDate::from_ymd_res(2000, 4, 20)?, @@ -35,14 +42,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2001, 4, 12)?, "Skírdagur"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Föstudagurinn langi"), @@ -67,14 +74,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2002, 3, 28)?, "Skírdagur"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Föstudagurinn langi"), @@ -99,14 +106,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2003, 4, 17)?, "Skírdagur"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Föstudagurinn langi"), @@ -131,14 +138,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2004, 4, 8)?, "Skírdagur"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Föstudagurinn langi"), @@ -163,14 +170,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2005, 3, 24)?, "Skírdagur"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Föstudagurinn langi"), @@ -195,14 +202,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2006, 4, 13)?, "Skírdagur"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Föstudagurinn langi"), @@ -227,14 +234,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2007, 4, 5)?, "Skírdagur"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Föstudagurinn langi"), @@ -259,14 +266,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2008, 3, 20)?, "Skírdagur"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Föstudagurinn langi"), @@ -293,14 +300,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2009, 4, 9)?, "Skírdagur"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Föstudagurinn langi"), @@ -325,14 +332,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2010, 4, 1)?, "Skírdagur"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Föstudagurinn langi"), @@ -357,14 +364,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Nýársdagur"), ( NaiveDate::from_ymd_res(2011, 4, 21)?, @@ -388,14 +395,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2012, 4, 5)?, "Skírdagur"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Föstudagurinn langi"), @@ -420,14 +427,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2013, 3, 28)?, "Skírdagur"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Föstudagurinn langi"), @@ -452,14 +459,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2014, 4, 17)?, "Skírdagur"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Föstudagurinn langi"), @@ -484,14 +491,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2015, 4, 2)?, "Skírdagur"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Föstudagurinn langi"), @@ -516,14 +523,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2016, 3, 24)?, "Skírdagur"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Föstudagurinn langi"), @@ -548,14 +555,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2017, 4, 13)?, "Skírdagur"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Föstudagurinn langi"), @@ -580,14 +587,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2018, 3, 29)?, "Skírdagur"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Föstudagurinn langi"), @@ -612,14 +619,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2019, 4, 18)?, "Skírdagur"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Föstudagurinn langi"), @@ -644,14 +651,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2020, 4, 9)?, "Skírdagur"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Föstudagurinn langi"), @@ -676,14 +683,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2021, 4, 1)?, "Skírdagur"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Föstudagurinn langi"), @@ -708,14 +715,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2022, 4, 14)?, "Skírdagur"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Föstudagurinn langi"), @@ -740,14 +747,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2023, 4, 6)?, "Skírdagur"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Föstudagurinn langi"), @@ -772,14 +779,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2024, 3, 28)?, "Skírdagur"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Föstudagurinn langi"), @@ -804,14 +811,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2025, 4, 17)?, "Skírdagur"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Föstudagurinn langi"), @@ -836,14 +843,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2026, 4, 2)?, "Skírdagur"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Föstudagurinn langi"), @@ -868,14 +875,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2027, 3, 25)?, "Skírdagur"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Föstudagurinn langi"), @@ -900,14 +907,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2028, 4, 13)?, "Skírdagur"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Föstudagurinn langi"), @@ -932,14 +939,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2029, 3, 29)?, "Skírdagur"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Föstudagurinn langi"), @@ -964,14 +971,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nýársdagur"), (NaiveDate::from_ymd_res(2030, 4, 18)?, "Skírdagur"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Föstudagurinn langi"), @@ -996,8 +1003,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 31)?, "Gamlársdagur"), ], &mut map, - Country::IS, - "Iceland", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/it.rs b/src/data/it.rs index fca352b..fa1997a 100644 --- a/src/data/it.rs +++ b/src/data/it.rs @@ -1,17 +1,24 @@ //! Italy +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Italy"; +const COUNTY_CODE: Country = Country::IT; + /// Generate holiday map for Italy. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Epifania del Signore"), ( @@ -41,14 +48,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Epifania del Signore"), ( @@ -78,14 +85,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2002, 1, 6)?, "Epifania del Signore"), ( @@ -115,14 +122,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Epifania del Signore"), ( @@ -152,14 +159,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Epifania del Signore"), ( @@ -189,14 +196,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Epifania del Signore"), ( @@ -226,14 +233,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Epifania del Signore"), ( @@ -263,14 +270,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Epifania del Signore"), ( @@ -300,14 +307,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2008, 1, 6)?, "Epifania del Signore"), ( @@ -337,14 +344,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Epifania del Signore"), ( @@ -374,14 +381,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Epifania del Signore"), ( @@ -411,14 +418,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Epifania del Signore"), ( @@ -451,14 +458,14 @@ pub fn build( ), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Epifania del Signore"), ( @@ -488,14 +495,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2013, 1, 6)?, "Epifania del Signore"), ( @@ -525,14 +532,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Epifania del Signore"), ( @@ -562,14 +569,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Epifania del Signore"), ( @@ -599,14 +606,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Epifania del Signore"), ( @@ -636,14 +643,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Epifania del Signore"), ( @@ -673,14 +680,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Epifania del Signore"), ( @@ -710,14 +717,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2019, 1, 6)?, "Epifania del Signore"), ( @@ -747,14 +754,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Epifania del Signore"), ( @@ -784,14 +791,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Epifania del Signore"), ( @@ -821,14 +828,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Epifania del Signore"), ( @@ -858,14 +865,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Epifania del Signore"), ( @@ -895,14 +902,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Epifania del Signore"), ( @@ -932,14 +939,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Epifania del Signore"), ( @@ -969,14 +976,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Epifania del Signore"), ( @@ -1006,14 +1013,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Epifania del Signore"), ( @@ -1043,14 +1050,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Epifania del Signore"), ( @@ -1080,14 +1087,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Epifania del Signore"), ( @@ -1117,14 +1124,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Capodanno"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Epifania del Signore"), ( @@ -1154,8 +1161,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Santo Stefano"), ], &mut map, - Country::IT, - "Italy", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/jm.rs b/src/data/jm.rs index 91e5d73..6a2b4e6 100644 --- a/src/data/jm.rs +++ b/src/data/jm.rs @@ -1,17 +1,24 @@ //! Jamaica +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Jamaica"; +const COUNTY_CODE: Country = Country::JM; + /// Generate holiday map for Jamaica. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 3, 8)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), @@ -31,14 +38,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 2, 28)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), @@ -54,14 +61,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 2, 13)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), @@ -77,14 +84,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 3, 5)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), @@ -100,14 +107,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 2, 25)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), @@ -135,14 +142,14 @@ pub fn build( ), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 2, 9)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), @@ -162,14 +169,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -193,14 +200,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 2, 21)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), @@ -216,14 +223,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 2, 6)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), @@ -239,14 +246,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 2, 25)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), @@ -266,14 +273,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 2, 17)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), @@ -301,14 +308,14 @@ pub fn build( ), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 3, 9)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), @@ -328,14 +335,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -355,14 +362,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 2, 13)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), @@ -378,14 +385,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 3, 5)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), @@ -401,14 +408,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 2, 18)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), @@ -428,14 +435,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 2, 10)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), @@ -455,14 +462,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -486,14 +493,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 2, 14)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), @@ -509,14 +516,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 3, 6)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), @@ -532,14 +539,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 2, 26)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 2, 17)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), @@ -594,14 +601,14 @@ pub fn build( ), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 3, 2)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), @@ -621,14 +628,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -652,14 +659,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 2, 14)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), @@ -675,14 +682,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 3, 5)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), @@ -698,14 +705,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 2, 18)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), @@ -725,14 +732,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 2, 10)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), @@ -760,14 +767,14 @@ pub fn build( ), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 3, 1)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), @@ -787,14 +794,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 2, 14)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), @@ -810,14 +817,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 3, 6)?, "Ash Wednesday"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), @@ -833,8 +840,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::JM, - "Jamaica", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/jp.rs b/src/data/jp.rs index e754300..6b9377c 100644 --- a/src/data/jp.rs +++ b/src/data/jp.rs @@ -1,17 +1,24 @@ //! Japan +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Japan"; +const COUNTY_CODE: Country = Country::JP; + /// Generate holiday map for Japan. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2000, 1, 10)?, "成人の日"), (NaiveDate::from_ymd_res(2000, 2, 11)?, "建国記念の日"), @@ -29,14 +36,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 5, 4)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2001, 1, 8)?, "成人の日"), (NaiveDate::from_ymd_res(2001, 2, 11)?, "建国記念の日"), @@ -58,14 +65,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 5, 4)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2002, 1, 14)?, "成人の日"), (NaiveDate::from_ymd_res(2002, 2, 11)?, "建国記念の日"), @@ -86,14 +93,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 5, 4)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2003, 1, 13)?, "成人の日"), (NaiveDate::from_ymd_res(2003, 2, 11)?, "建国記念の日"), @@ -111,14 +118,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 11, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2004, 1, 12)?, "成人の日"), (NaiveDate::from_ymd_res(2004, 2, 11)?, "建国記念の日"), @@ -136,14 +143,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 5, 4)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2005, 1, 10)?, "成人の日"), (NaiveDate::from_ymd_res(2005, 2, 11)?, "建国記念の日"), @@ -162,14 +169,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 5, 4)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2006, 1, 9)?, "成人の日"), (NaiveDate::from_ymd_res(2006, 2, 11)?, "建国記念の日"), @@ -188,14 +195,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 5, 4)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2007, 1, 8)?, "成人の日"), (NaiveDate::from_ymd_res(2007, 2, 11)?, "建国記念の日"), @@ -217,14 +224,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2008, 1, 14)?, "成人の日"), (NaiveDate::from_ymd_res(2008, 2, 11)?, "建国記念の日"), @@ -244,14 +251,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 11, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2009, 1, 12)?, "成人の日"), (NaiveDate::from_ymd_res(2009, 2, 11)?, "建国記念の日"), @@ -271,14 +278,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 9, 22)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2010, 1, 11)?, "成人の日"), (NaiveDate::from_ymd_res(2010, 2, 11)?, "建国記念の日"), @@ -297,14 +304,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 3, 22)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2011, 1, 10)?, "成人の日"), (NaiveDate::from_ymd_res(2011, 2, 11)?, "建国記念の日"), @@ -322,14 +329,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 23)?, "天皇誕生日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2012, 1, 9)?, "成人の日"), (NaiveDate::from_ymd_res(2012, 2, 11)?, "建国記念の日"), @@ -350,14 +357,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2013, 1, 14)?, "成人の日"), (NaiveDate::from_ymd_res(2013, 2, 11)?, "建国記念の日"), @@ -377,14 +384,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 11, 4)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2014, 1, 13)?, "成人の日"), (NaiveDate::from_ymd_res(2014, 2, 11)?, "建国記念の日"), @@ -404,14 +411,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 11, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2015, 1, 12)?, "成人の日"), (NaiveDate::from_ymd_res(2015, 2, 11)?, "建国記念の日"), @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 9, 22)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2016, 1, 11)?, "成人の日"), (NaiveDate::from_ymd_res(2016, 2, 11)?, "建国記念の日"), @@ -458,14 +465,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 3, 21)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2017, 1, 9)?, "成人の日"), (NaiveDate::from_ymd_res(2017, 2, 11)?, "建国記念の日"), @@ -485,14 +492,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 1, 2)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2018, 1, 8)?, "成人の日"), (NaiveDate::from_ymd_res(2018, 2, 11)?, "建国記念の日"), @@ -515,14 +522,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2019, 1, 14)?, "成人の日"), (NaiveDate::from_ymd_res(2019, 2, 11)?, "建国記念の日"), @@ -550,14 +557,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 5, 2)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2020, 1, 13)?, "成人の日"), (NaiveDate::from_ymd_res(2020, 2, 11)?, "建国記念の日"), @@ -578,14 +585,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 5, 6)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2021, 1, 11)?, "成人の日"), (NaiveDate::from_ymd_res(2021, 2, 11)?, "建国記念の日"), @@ -605,14 +612,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 8, 9)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2022, 1, 10)?, "成人の日"), (NaiveDate::from_ymd_res(2022, 2, 11)?, "建国記念の日"), @@ -631,14 +638,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 11, 23)?, "勤労感謝の日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2023, 1, 9)?, "成人の日"), (NaiveDate::from_ymd_res(2023, 2, 11)?, "建国記念の日"), @@ -658,14 +665,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 1, 2)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2024, 1, 8)?, "成人の日"), (NaiveDate::from_ymd_res(2024, 2, 11)?, "建国記念の日"), @@ -689,14 +696,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 11, 4)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2025, 1, 13)?, "成人の日"), (NaiveDate::from_ymd_res(2025, 2, 11)?, "建国記念の日"), @@ -718,14 +725,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 11, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2026, 1, 12)?, "成人の日"), (NaiveDate::from_ymd_res(2026, 2, 11)?, "建国記念の日"), @@ -746,14 +753,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 9, 22)?, "国民の休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2027, 1, 11)?, "成人の日"), (NaiveDate::from_ymd_res(2027, 2, 11)?, "建国記念の日"), @@ -773,14 +780,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 3, 22)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2028, 1, 10)?, "成人の日"), (NaiveDate::from_ymd_res(2028, 2, 11)?, "建国記念の日"), @@ -799,14 +806,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 11, 23)?, "勤労感謝の日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2029, 1, 8)?, "成人の日"), (NaiveDate::from_ymd_res(2029, 2, 11)?, "建国記念の日"), @@ -828,14 +835,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 9, 24)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "元日"), (NaiveDate::from_ymd_res(2030, 1, 14)?, "成人の日"), (NaiveDate::from_ymd_res(2030, 2, 11)?, "建国記念の日"), @@ -857,8 +864,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 11, 4)?, "振替休日"), ], &mut map, - Country::JP, - "Japan", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ke.rs b/src/data/ke.rs index 1ac145a..2d5ebbe 100644 --- a/src/data/ke.rs +++ b/src/data/ke.rs @@ -1,17 +1,24 @@ //! Kenya +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Kenya"; +const COUNTY_CODE: Country = Country::KE; + /// Generate holiday map for Kenya. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Easter Monday"), @@ -22,14 +29,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Easter Monday"), @@ -40,14 +47,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Easter Monday"), @@ -63,14 +70,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Easter Monday"), @@ -82,14 +89,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Easter Monday"), @@ -110,14 +117,14 @@ pub fn build( ), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Easter Monday"), @@ -137,14 +144,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -160,14 +167,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Easter Monday"), @@ -179,14 +186,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Easter Monday"), @@ -198,14 +205,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Easter Monday"), @@ -217,14 +224,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Easter Monday"), @@ -244,14 +251,14 @@ pub fn build( ), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Easter Monday"), @@ -271,14 +278,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -294,14 +301,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Easter Monday"), @@ -317,14 +324,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Easter Monday"), @@ -340,14 +347,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Easter Monday"), @@ -359,14 +366,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Easter Monday"), @@ -386,14 +393,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -409,14 +416,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Easter Monday"), @@ -429,14 +436,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Easter Monday"), @@ -453,14 +460,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Easter Monday"), @@ -477,14 +484,14 @@ pub fn build( ), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Easter Monday"), @@ -509,14 +516,14 @@ pub fn build( ), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Easter Monday"), @@ -555,14 +562,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 9, 13)?, "Inauguration Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -579,14 +586,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Easter Monday"), @@ -603,14 +610,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Easter Monday"), @@ -627,14 +634,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Easter Monday"), @@ -647,14 +654,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Easter Monday"), @@ -679,14 +686,14 @@ pub fn build( ), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Easter Monday"), @@ -699,14 +706,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Easter Monday"), @@ -719,14 +726,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Easter Monday"), @@ -743,8 +750,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::KE, - "Kenya", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/kr.rs b/src/data/kr.rs index 1973a70..d380b1d 100644 --- a/src/data/kr.rs +++ b/src/data/kr.rs @@ -1,17 +1,24 @@ //! South Korea +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "South Korea"; +const COUNTY_CODE: Country = Country::KR; + /// Generate holiday map for South Korea. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2000, 2, 5)?, "설날"), (NaiveDate::from_ymd_res(2000, 2, 4)?, "설날 전날"), @@ -31,14 +38,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 4, 13)?, "국회의원 선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2001, 1, 24)?, "설날"), (NaiveDate::from_ymd_res(2001, 1, 23)?, "설날 전날"), @@ -57,14 +64,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "기독탄신일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2002, 2, 12)?, "설날"), (NaiveDate::from_ymd_res(2002, 2, 11)?, "설날 전날"), @@ -89,14 +96,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 19)?, "대통령 선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2003, 2, 1)?, "설날"), (NaiveDate::from_ymd_res(2003, 1, 31)?, "설날 전날"), @@ -115,14 +122,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "기독탄신일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2004, 1, 22)?, "설날"), (NaiveDate::from_ymd_res(2004, 1, 21)?, "설날 전날"), @@ -142,14 +149,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 4, 15)?, "국회의원 선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2005, 2, 9)?, "설날"), (NaiveDate::from_ymd_res(2005, 2, 8)?, "설날 전날"), @@ -168,14 +175,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "기독탄신일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2006, 1, 29)?, "설날"), (NaiveDate::from_ymd_res(2006, 1, 28)?, "설날 전날"), @@ -193,14 +200,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 5, 31)?, "지방선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2007, 2, 18)?, "설날"), (NaiveDate::from_ymd_res(2007, 2, 17)?, "설날 전날"), @@ -219,14 +226,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 19)?, "대통령 선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2008, 2, 7)?, "설날"), (NaiveDate::from_ymd_res(2008, 2, 6)?, "설날 전날"), @@ -244,14 +251,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 4, 9)?, "국회의원 선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2009, 1, 26)?, "설날"), (NaiveDate::from_ymd_res(2009, 1, 25)?, "설날 전날"), @@ -267,14 +274,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "기독탄신일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2010, 2, 14)?, "설날"), (NaiveDate::from_ymd_res(2010, 2, 13)?, "설날 전날"), @@ -292,14 +299,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 6, 2)?, "지방선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2011, 2, 3)?, "설날"), (NaiveDate::from_ymd_res(2011, 2, 2)?, "설날 전날"), @@ -316,14 +323,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "기독탄신일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2012, 1, 23)?, "설날"), (NaiveDate::from_ymd_res(2012, 1, 22)?, "설날 전날"), @@ -342,14 +349,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 19)?, "대통령 선거일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2013, 2, 10)?, "설날"), (NaiveDate::from_ymd_res(2013, 2, 9)?, "설날 전날"), @@ -367,14 +374,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "기독탄신일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2014, 1, 31)?, "설날"), (NaiveDate::from_ymd_res(2014, 1, 30)?, "설날 전날"), @@ -394,14 +401,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 9, 10)?, "추석 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2015, 2, 19)?, "설날"), (NaiveDate::from_ymd_res(2015, 2, 18)?, "설날 전날"), @@ -421,14 +428,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 8, 14)?, "임시공휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "설날"), (NaiveDate::from_ymd_res(2016, 2, 7)?, "설날 전날"), @@ -449,14 +456,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 5, 6)?, "임시공휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2017, 1, 28)?, "설날"), (NaiveDate::from_ymd_res(2017, 1, 27)?, "설날 전날"), @@ -477,14 +484,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 10, 2)?, "임시공휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2018, 2, 16)?, "설날"), (NaiveDate::from_ymd_res(2018, 2, 15)?, "설날 전날"), @@ -505,14 +512,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 9, 26)?, "추석 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2019, 2, 5)?, "설날"), (NaiveDate::from_ymd_res(2019, 2, 4)?, "설날 전날"), @@ -531,14 +538,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 5, 6)?, "어린이날 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2020, 1, 25)?, "설날"), (NaiveDate::from_ymd_res(2020, 1, 24)?, "설날 전날"), @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 8, 17)?, "임시공휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2021, 2, 12)?, "설날"), (NaiveDate::from_ymd_res(2021, 2, 11)?, "설날 전날"), @@ -587,14 +594,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 10, 11)?, "한글날 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2022, 2, 1)?, "설날"), (NaiveDate::from_ymd_res(2022, 1, 31)?, "설날 전날"), @@ -616,14 +623,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 10, 10)?, "한글날 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2023, 1, 22)?, "설날"), (NaiveDate::from_ymd_res(2023, 1, 21)?, "설날 전날"), @@ -647,14 +654,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 10, 2)?, "임시공휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2024, 2, 10)?, "설날"), (NaiveDate::from_ymd_res(2024, 2, 9)?, "설날 전날"), @@ -675,14 +682,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 5, 6)?, "어린이날 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2025, 1, 29)?, "설날"), (NaiveDate::from_ymd_res(2025, 1, 28)?, "설날 전날"), @@ -708,14 +715,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 10, 8)?, "추석 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2026, 2, 17)?, "설날"), (NaiveDate::from_ymd_res(2026, 2, 16)?, "설날 전날"), @@ -741,14 +748,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 10, 5)?, "개천절 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2027, 2, 7)?, "설날"), (NaiveDate::from_ymd_res(2027, 2, 6)?, "설날 전날"), @@ -775,14 +782,14 @@ pub fn build( ), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2028, 1, 27)?, "설날"), (NaiveDate::from_ymd_res(2028, 1, 26)?, "설날 전날"), @@ -801,14 +808,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 10, 5)?, "추석 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2029, 2, 13)?, "설날"), (NaiveDate::from_ymd_res(2029, 2, 12)?, "설날 전날"), @@ -832,14 +839,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 9, 24)?, "추석 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "신정연휴"), (NaiveDate::from_ymd_res(2030, 2, 3)?, "설날"), (NaiveDate::from_ymd_res(2030, 2, 2)?, "설날 전날"), @@ -860,8 +867,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 5, 6)?, "어린이날 대체 휴일"), ], &mut map, - Country::KR, - "South Korea", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/kz.rs b/src/data/kz.rs index 735d14d..23a47e9 100644 --- a/src/data/kz.rs +++ b/src/data/kz.rs @@ -1,17 +1,24 @@ //! Kazakhstan +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Kazakhstan"; +const COUNTY_CODE: Country = Country::KZ; + /// Generate holiday map for Kazakhstan. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2000, 1, 2)?, "New Year"), ( @@ -34,14 +41,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2001, 1, 2)?, "New Year"), ( @@ -64,14 +71,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2002, 1, 2)?, "New Year"), ( @@ -99,14 +106,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2003, 1, 2)?, "New Year"), ( @@ -150,14 +157,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2004, 1, 2)?, "New Year"), ( @@ -193,14 +200,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2005, 1, 2)?, "New Year"), ( @@ -238,14 +245,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2006, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2006, 1, 7)?, "Orthodox Christmas"), @@ -291,14 +298,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2007, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2007, 1, 7)?, "Orthodox Christmas"), @@ -335,14 +342,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2008, 1, 7)?, "Orthodox Christmas"), @@ -391,14 +398,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2009, 1, 7)?, "Orthodox Christmas"), @@ -447,14 +454,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2010, 1, 7)?, "Orthodox Christmas"), @@ -502,14 +509,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2011, 1, 7)?, "Orthodox Christmas"), @@ -554,14 +561,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2012, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2012, 1, 7)?, "Orthodox Christmas"), @@ -606,14 +613,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2013, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2013, 1, 7)?, "Orthodox Christmas"), @@ -665,14 +672,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2014, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2014, 1, 7)?, "Orthodox Christmas"), @@ -732,14 +739,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2015, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2015, 1, 7)?, "Orthodox Christmas"), @@ -799,14 +806,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2016, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2016, 1, 7)?, "Orthodox Christmas"), @@ -859,14 +866,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2017, 1, 7)?, "Orthodox Christmas"), @@ -919,14 +926,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2018, 1, 7)?, "Orthodox Christmas"), @@ -974,14 +981,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2019, 1, 7)?, "Orthodox Christmas"), @@ -1033,14 +1040,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2020, 1, 7)?, "Orthodox Christmas"), @@ -1100,14 +1107,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2021, 1, 7)?, "Orthodox Christmas"), @@ -1160,14 +1167,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2022, 1, 7)?, "Orthodox Christmas"), @@ -1213,14 +1220,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2023, 1, 7)?, "Orthodox Christmas"), @@ -1265,14 +1272,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2024, 1, 7)?, "Orthodox Christmas"), @@ -1316,14 +1323,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2025, 1, 7)?, "Orthodox Christmas"), @@ -1383,14 +1390,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2026, 1, 7)?, "Orthodox Christmas"), @@ -1450,14 +1457,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2027, 1, 7)?, "Orthodox Christmas"), @@ -1506,14 +1513,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2028, 1, 7)?, "Orthodox Christmas"), @@ -1559,14 +1566,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2029, 1, 7)?, "Orthodox Christmas"), @@ -1606,14 +1613,14 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "New Year"), (NaiveDate::from_ymd_res(2030, 1, 7)?, "Orthodox Christmas"), @@ -1657,8 +1664,8 @@ pub fn build( ), ], &mut map, - Country::KZ, - "Kazakhstan", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/li.rs b/src/data/li.rs index 9662d00..d85bde3 100644 --- a/src/data/li.rs +++ b/src/data/li.rs @@ -1,17 +1,24 @@ //! Liechtenstein +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Liechtenstein"; +const COUNTY_CODE: Country = Country::LI; + /// Generate holiday map for Liechtenstein. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2000, 2, 2)?, "Mariä Lichtmess"), @@ -31,14 +38,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2001, 2, 2)?, "Mariä Lichtmess"), @@ -58,14 +65,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2002, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2002, 2, 2)?, "Mariä Lichtmess"), @@ -85,14 +92,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2003, 2, 2)?, "Mariä Lichtmess"), @@ -112,14 +119,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2004, 2, 2)?, "Mariä Lichtmess"), @@ -139,14 +146,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2005, 2, 2)?, "Mariä Lichtmess"), @@ -166,14 +173,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2006, 2, 2)?, "Mariä Lichtmess"), @@ -193,14 +200,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2007, 2, 2)?, "Mariä Lichtmess"), @@ -220,14 +227,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2008, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2008, 2, 2)?, "Mariä Lichtmess"), @@ -249,14 +256,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2009, 2, 2)?, "Mariä Lichtmess"), @@ -276,14 +283,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2010, 2, 2)?, "Mariä Lichtmess"), @@ -303,14 +310,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2011, 2, 2)?, "Mariä Lichtmess"), @@ -330,14 +337,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2012, 2, 2)?, "Mariä Lichtmess"), @@ -357,14 +364,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2013, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2013, 2, 2)?, "Mariä Lichtmess"), @@ -384,14 +391,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2014, 2, 2)?, "Mariä Lichtmess"), @@ -411,14 +418,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2015, 2, 2)?, "Mariä Lichtmess"), @@ -438,14 +445,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2016, 2, 2)?, "Mariä Lichtmess"), @@ -465,14 +472,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2017, 2, 2)?, "Mariä Lichtmess"), @@ -492,14 +499,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2018, 2, 2)?, "Mariä Lichtmess"), @@ -519,14 +526,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2019, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2019, 2, 2)?, "Mariä Lichtmess"), @@ -546,14 +553,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2020, 2, 2)?, "Mariä Lichtmess"), @@ -573,14 +580,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2021, 2, 2)?, "Mariä Lichtmess"), @@ -600,14 +607,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2022, 2, 2)?, "Mariä Lichtmess"), @@ -627,14 +634,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2023, 2, 2)?, "Mariä Lichtmess"), @@ -654,14 +661,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2024, 2, 2)?, "Mariä Lichtmess"), @@ -681,14 +688,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2025, 2, 2)?, "Mariä Lichtmess"), @@ -708,14 +715,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2026, 2, 2)?, "Mariä Lichtmess"), @@ -735,14 +742,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2027, 2, 2)?, "Mariä Lichtmess"), @@ -762,14 +769,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2028, 2, 2)?, "Mariä Lichtmess"), @@ -789,14 +796,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2029, 2, 2)?, "Mariä Lichtmess"), @@ -816,14 +823,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Heilige Drei Könige"), (NaiveDate::from_ymd_res(2030, 2, 2)?, "Mariä Lichtmess"), @@ -843,8 +850,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Stephanstag"), ], &mut map, - Country::LI, - "Liechtenstein", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ls.rs b/src/data/ls.rs index 55bece2..3090ac2 100644 --- a/src/data/ls.rs +++ b/src/data/ls.rs @@ -1,17 +1,24 @@ //! Lesotho +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Lesotho"; +const COUNTY_CODE: Country = Country::LS; + /// Generate holiday map for Lesotho. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2000, 4, 4)?, "Heroes Day"), @@ -25,14 +32,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2001, 4, 4)?, "Heroes Day"), @@ -46,14 +53,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2002, 4, 4)?, "Heroes Day"), @@ -68,14 +75,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 5, 25)?, "Africa Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2003, 5, 25)?, "Africa/Heroes Day"), @@ -89,14 +96,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2004, 5, 25)?, "Africa/Heroes Day"), @@ -110,14 +117,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2005, 5, 25)?, "Africa/Heroes Day"), @@ -131,14 +138,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2006, 3, 11)?, "Moshoeshoe's Day"), ( @@ -154,14 +161,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2007, 5, 25)?, "Africa/Heroes Day"), @@ -175,14 +182,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2008, 5, 25)?, "Africa/Heroes Day"), @@ -198,14 +205,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2009, 5, 25)?, "Africa/Heroes Day"), @@ -219,14 +226,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2010, 5, 25)?, "Africa/Heroes Day"), @@ -240,14 +247,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2011, 5, 25)?, "Africa/Heroes Day"), @@ -261,14 +268,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2012, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2012, 5, 25)?, "Africa/Heroes Day"), @@ -282,14 +289,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2013, 5, 25)?, "Africa/Heroes Day"), @@ -303,14 +310,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2014, 5, 25)?, "Africa/Heroes Day"), @@ -324,14 +331,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2015, 5, 25)?, "Africa/Heroes Day"), @@ -345,14 +352,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2016, 5, 25)?, "Africa/Heroes Day"), @@ -366,14 +373,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2017, 3, 11)?, "Moshoeshoe's Day"), ( @@ -389,14 +396,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2018, 5, 25)?, "Africa/Heroes Day"), @@ -410,14 +417,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2019, 5, 25)?, "Africa/Heroes Day"), @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2020, 5, 25)?, "Africa/Heroes Day"), @@ -452,14 +459,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2021, 5, 25)?, "Africa/Heroes Day"), @@ -473,14 +480,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2022, 5, 25)?, "Africa/Heroes Day"), @@ -494,14 +501,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2023, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2023, 5, 25)?, "Africa/Heroes Day"), @@ -515,14 +522,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2024, 5, 25)?, "Africa/Heroes Day"), @@ -536,14 +543,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2025, 5, 25)?, "Africa/Heroes Day"), @@ -557,14 +564,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2026, 5, 25)?, "Africa/Heroes Day"), @@ -578,14 +585,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2027, 5, 25)?, "Africa/Heroes Day"), @@ -599,14 +606,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 3, 11)?, "Moshoeshoe's Day"), ( @@ -622,14 +629,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2029, 5, 25)?, "Africa/Heroes Day"), @@ -643,14 +650,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 3, 11)?, "Moshoeshoe's Day"), (NaiveDate::from_ymd_res(2030, 5, 25)?, "Africa/Heroes Day"), @@ -664,8 +671,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::LS, - "Lesotho", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/lt.rs b/src/data/lt.rs index 4f207ba..b5867b4 100644 --- a/src/data/lt.rs +++ b/src/data/lt.rs @@ -1,17 +1,24 @@ //! Lithuania +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Lithuania"; +const COUNTY_CODE: Country = Country::LT; + /// Generate holiday map for Lithuania. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2000, 2, 16)?, @@ -52,14 +59,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2001, 2, 16)?, @@ -100,14 +107,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2002, 2, 16)?, @@ -148,14 +155,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2003, 2, 16)?, @@ -200,14 +207,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2004, 2, 16)?, @@ -252,14 +259,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2005, 2, 16)?, @@ -303,14 +310,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2006, 2, 16)?, @@ -355,14 +362,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2007, 2, 16)?, @@ -407,14 +414,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2008, 2, 16)?, @@ -459,14 +466,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2009, 2, 16)?, @@ -511,14 +518,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2010, 2, 16)?, @@ -563,14 +570,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2011, 2, 16)?, @@ -614,14 +621,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2012, 2, 16)?, @@ -666,14 +673,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2013, 2, 16)?, @@ -718,14 +725,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2014, 2, 16)?, @@ -770,14 +777,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2015, 2, 16)?, @@ -822,14 +829,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2016, 2, 16)?, @@ -873,14 +880,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2017, 2, 16)?, @@ -925,14 +932,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2018, 2, 16)?, @@ -977,14 +984,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2019, 2, 16)?, @@ -1029,14 +1036,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2020, 2, 16)?, @@ -1085,14 +1092,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2021, 2, 16)?, @@ -1141,14 +1148,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2022, 2, 16)?, @@ -1196,14 +1203,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2023, 2, 16)?, @@ -1252,14 +1259,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2024, 2, 16)?, @@ -1308,14 +1315,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2025, 2, 16)?, @@ -1364,14 +1371,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2026, 2, 16)?, @@ -1420,14 +1427,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2027, 2, 16)?, @@ -1476,14 +1483,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2028, 2, 16)?, @@ -1532,14 +1539,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2029, 2, 16)?, @@ -1588,14 +1595,14 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Naujųjų metų diena"), ( NaiveDate::from_ymd_res(2030, 2, 16)?, @@ -1644,8 +1651,8 @@ pub fn build( ), ], &mut map, - Country::LT, - "Lithuania", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/lu.rs b/src/data/lu.rs index 2e0452d..b7d6a1f 100644 --- a/src/data/lu.rs +++ b/src/data/lu.rs @@ -1,17 +1,24 @@ //! Luxembourg +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Luxembourg"; +const COUNTY_CODE: Country = Country::LU; + /// Generate holiday map for Luxembourg. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Ostermontag"), (NaiveDate::from_ymd_res(2000, 5, 1)?, "Tag der Arbeit"), @@ -27,14 +34,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Ostermontag"), (NaiveDate::from_ymd_res(2001, 5, 1)?, "Tag der Arbeit"), @@ -50,14 +57,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Ostermontag"), (NaiveDate::from_ymd_res(2002, 5, 1)?, "Tag der Arbeit"), @@ -73,14 +80,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Ostermontag"), (NaiveDate::from_ymd_res(2003, 5, 1)?, "Tag der Arbeit"), @@ -96,14 +103,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Ostermontag"), (NaiveDate::from_ymd_res(2004, 5, 1)?, "Tag der Arbeit"), @@ -119,14 +126,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Ostermontag"), (NaiveDate::from_ymd_res(2005, 5, 1)?, "Tag der Arbeit"), @@ -142,14 +149,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Ostermontag"), (NaiveDate::from_ymd_res(2006, 5, 1)?, "Tag der Arbeit"), @@ -165,14 +172,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Ostermontag"), (NaiveDate::from_ymd_res(2007, 5, 1)?, "Tag der Arbeit"), @@ -188,14 +195,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Ostermontag"), ( @@ -213,14 +220,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Ostermontag"), (NaiveDate::from_ymd_res(2009, 5, 1)?, "Tag der Arbeit"), @@ -236,14 +243,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Ostermontag"), (NaiveDate::from_ymd_res(2010, 5, 1)?, "Tag der Arbeit"), @@ -259,14 +266,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Ostermontag"), (NaiveDate::from_ymd_res(2011, 5, 1)?, "Tag der Arbeit"), @@ -282,14 +289,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Ostermontag"), (NaiveDate::from_ymd_res(2012, 5, 1)?, "Tag der Arbeit"), @@ -305,14 +312,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Ostermontag"), (NaiveDate::from_ymd_res(2013, 5, 1)?, "Tag der Arbeit"), @@ -328,14 +335,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Ostermontag"), (NaiveDate::from_ymd_res(2014, 5, 1)?, "Tag der Arbeit"), @@ -351,14 +358,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Ostermontag"), (NaiveDate::from_ymd_res(2015, 5, 1)?, "Tag der Arbeit"), @@ -374,14 +381,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Ostermontag"), (NaiveDate::from_ymd_res(2016, 5, 1)?, "Tag der Arbeit"), @@ -397,14 +404,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Ostermontag"), (NaiveDate::from_ymd_res(2017, 5, 1)?, "Tag der Arbeit"), @@ -420,14 +427,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Ostermontag"), (NaiveDate::from_ymd_res(2018, 5, 1)?, "Tag der Arbeit"), @@ -443,14 +450,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Ostermontag"), (NaiveDate::from_ymd_res(2019, 5, 1)?, "Tag der Arbeit"), @@ -467,14 +474,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Ostermontag"), (NaiveDate::from_ymd_res(2020, 5, 1)?, "Tag der Arbeit"), @@ -491,14 +498,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Ostermontag"), (NaiveDate::from_ymd_res(2021, 5, 1)?, "Tag der Arbeit"), @@ -515,14 +522,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Ostermontag"), (NaiveDate::from_ymd_res(2022, 5, 1)?, "Tag der Arbeit"), @@ -539,14 +546,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2023, 4, 10)?, "Ostermontag"), (NaiveDate::from_ymd_res(2023, 5, 1)?, "Tag der Arbeit"), @@ -563,14 +570,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Ostermontag"), (NaiveDate::from_ymd_res(2024, 5, 1)?, "Tag der Arbeit"), @@ -589,14 +596,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Ostermontag"), (NaiveDate::from_ymd_res(2025, 5, 1)?, "Tag der Arbeit"), @@ -613,14 +620,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Ostermontag"), (NaiveDate::from_ymd_res(2026, 5, 1)?, "Tag der Arbeit"), @@ -637,14 +644,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Ostermontag"), (NaiveDate::from_ymd_res(2027, 5, 1)?, "Tag der Arbeit"), @@ -661,14 +668,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Ostermontag"), (NaiveDate::from_ymd_res(2028, 5, 1)?, "Tag der Arbeit"), @@ -685,14 +692,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Ostermontag"), (NaiveDate::from_ymd_res(2029, 5, 1)?, "Tag der Arbeit"), @@ -709,14 +716,14 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Neujahr"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Ostermontag"), (NaiveDate::from_ymd_res(2030, 5, 1)?, "Tag der Arbeit"), @@ -733,8 +740,8 @@ pub fn build( ), ], &mut map, - Country::LU, - "Luxembourg", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/lv.rs b/src/data/lv.rs index f8ecb2a..4ef05ed 100644 --- a/src/data/lv.rs +++ b/src/data/lv.rs @@ -1,17 +1,24 @@ //! Latvia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Latvia"; +const COUNTY_CODE: Country = Country::LV; + /// Generate holiday map for Latvia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2000, 4, 23)?, "Lieldienas"), @@ -29,14 +36,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2001, 4, 15)?, "Lieldienas"), @@ -54,14 +61,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2002, 3, 31)?, "Lieldienas"), @@ -83,14 +90,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2003, 4, 20)?, "Lieldienas"), @@ -112,14 +119,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2004, 4, 11)?, "Lieldienas"), @@ -141,14 +148,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2005, 3, 27)?, "Lieldienas"), @@ -170,14 +177,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2006, 4, 16)?, "Lieldienas"), @@ -199,14 +206,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2007, 4, 8)?, "Lieldienas"), @@ -236,14 +243,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2008, 3, 23)?, "Lieldienas"), @@ -273,14 +280,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2009, 4, 12)?, "Lieldienas"), @@ -306,14 +313,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2010, 4, 4)?, "Lieldienas"), @@ -339,14 +346,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2011, 4, 24)?, "Lieldienas"), @@ -372,14 +379,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2012, 4, 8)?, "Lieldienas"), @@ -409,14 +416,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2013, 3, 31)?, "Lieldienas"), @@ -446,14 +453,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2014, 4, 20)?, "Lieldienas"), @@ -483,14 +490,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2015, 4, 5)?, "Lieldienas"), @@ -516,14 +523,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2016, 3, 27)?, "Lieldienas"), @@ -549,14 +556,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2017, 4, 16)?, "Lieldienas"), @@ -586,14 +593,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2018, 4, 1)?, "Lieldienas"), @@ -631,14 +638,14 @@ pub fn build( ), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2019, 4, 21)?, "Lieldienas"), @@ -668,14 +675,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2020, 4, 12)?, "Lieldienas"), @@ -701,14 +708,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2021, 4, 4)?, "Lieldienas"), @@ -734,14 +741,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2022, 4, 17)?, "Lieldienas"), @@ -767,42 +774,41 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( - years, - 2023, - vec![ - - (NaiveDate::from_ymd_res(2023, 1, 1)?, "Jaunais Gads"), - (NaiveDate::from_ymd_res(2023, 4, 7)?, "Lielā Piektdiena"), - (NaiveDate::from_ymd_res(2023, 4, 9)?, "Lieldienas"), - (NaiveDate::from_ymd_res(2023, 4, 10)?, "Otrās Lieldienas"), - (NaiveDate::from_ymd_res(2023, 5, 1)?, "Darba svētki"), - (NaiveDate::from_ymd_res(2023, 5, 4)?, "Latvijas Republikas Neatkarības atjaunošanas diena"), - (NaiveDate::from_ymd_res(2023, 5, 14)?, "Mātes diena"), - (NaiveDate::from_ymd_res(2023, 6, 23)?, "Līgo diena"), - (NaiveDate::from_ymd_res(2023, 6, 24)?, "Jāņu diena"), - (NaiveDate::from_ymd_res(2023, 11, 18)?, "Latvijas Republikas proklamēšanas diena"), - (NaiveDate::from_ymd_res(2023, 11, 20)?, "Latvijas Republikas proklamēšanas diena (brīvdiena)"), - (NaiveDate::from_ymd_res(2023, 12, 24)?, "Ziemassvētku vakars"), - (NaiveDate::from_ymd_res(2023, 12, 25)?, "Ziemassvētki"), - (NaiveDate::from_ymd_res(2023, 12, 26)?, "Otrie Ziemassvētki"), - (NaiveDate::from_ymd_res(2023, 12, 31)?, "Vecgada vakars"), - (NaiveDate::from_ymd_res(2023, 5, 29)?, "Diena, kad Latvijas hokeja komanda ieguva bronzas medaļu 2023. gada Pasaules hokeja čempionātā"), - (NaiveDate::from_ymd_res(2023, 7, 10)?, "Vispārējo latviešu Dziesmu un deju svētku noslēguma dienu"), - ], - &mut map, - Country::LV, - "Latvia", - ); + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 1)?, "Jaunais Gads"), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Lielā Piektdiena"), + (NaiveDate::from_ymd_res(2023, 4, 9)?, "Lieldienas"), + (NaiveDate::from_ymd_res(2023, 4, 10)?, "Otrās Lieldienas"), + (NaiveDate::from_ymd_res(2023, 5, 1)?, "Darba svētki"), + (NaiveDate::from_ymd_res(2023, 5, 4)?, "Latvijas Republikas Neatkarības atjaunošanas diena"), + (NaiveDate::from_ymd_res(2023, 5, 14)?, "Mātes diena"), + (NaiveDate::from_ymd_res(2023, 6, 23)?, "Līgo diena"), + (NaiveDate::from_ymd_res(2023, 6, 24)?, "Jāņu diena"), + (NaiveDate::from_ymd_res(2023, 11, 18)?, "Latvijas Republikas proklamēšanas diena"), + (NaiveDate::from_ymd_res(2023, 11, 20)?, "Latvijas Republikas proklamēšanas diena (brīvdiena)"), + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Ziemassvētku vakars"), + (NaiveDate::from_ymd_res(2023, 12, 25)?, "Ziemassvētki"), + (NaiveDate::from_ymd_res(2023, 12, 26)?, "Otrie Ziemassvētki"), + (NaiveDate::from_ymd_res(2023, 12, 31)?, "Vecgada vakars"), + (NaiveDate::from_ymd_res(2023, 5, 29)?, "Diena, kad Latvijas hokeja komanda ieguva bronzas medaļu 2023. gada Pasaules hokeja čempionātā"), + (NaiveDate::from_ymd_res(2023, 7, 10)?, "Vispārējo latviešu Dziesmu un deju svētku noslēguma dienu"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2024, 3, 31)?, "Lieldienas"), @@ -832,14 +838,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2025, 4, 20)?, "Lieldienas"), @@ -869,14 +875,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2026, 4, 5)?, "Lieldienas"), @@ -902,14 +908,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2027, 3, 28)?, "Lieldienas"), @@ -935,14 +941,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2028, 4, 16)?, "Lieldienas"), @@ -972,14 +978,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2029, 4, 1)?, "Lieldienas"), @@ -1009,14 +1015,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Jaunais Gads"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Lielā Piektdiena"), (NaiveDate::from_ymd_res(2030, 4, 21)?, "Lieldienas"), @@ -1046,8 +1052,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 31)?, "Vecgada vakars"), ], &mut map, - Country::LV, - "Latvia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ma.rs b/src/data/ma.rs index 0cde4d9..c683eb6 100644 --- a/src/data/ma.rs +++ b/src/data/ma.rs @@ -1,17 +1,24 @@ //! Morocco +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Morocco"; +const COUNTY_CODE: Country = Country::MA; + /// Generate holiday map for Morocco. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2000, 1, 11)?, @@ -53,14 +60,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2001, 1, 11)?, @@ -100,14 +107,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2002, 1, 11)?, @@ -147,14 +154,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2003, 1, 11)?, @@ -194,14 +201,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2004, 1, 11)?, @@ -240,14 +247,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2005, 1, 11)?, @@ -287,14 +294,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2006, 1, 11)?, @@ -334,14 +341,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "(تقدير) عيد الأضحى; رأس السنة الميلادية", @@ -384,14 +391,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2008, 1, 11)?, @@ -435,14 +442,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2009, 1, 11)?, @@ -482,14 +489,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2010, 1, 11)?, @@ -529,14 +536,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2011, 1, 11)?, @@ -575,14 +582,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2012, 1, 11)?, @@ -621,14 +628,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2013, 1, 11)?, @@ -668,14 +675,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2014, 1, 11)?, @@ -715,14 +722,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2015, 1, 11)?, @@ -770,14 +777,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2016, 1, 11)?, @@ -817,14 +824,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2017, 1, 11)?, @@ -864,14 +871,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2018, 1, 11)?, @@ -913,14 +920,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2019, 1, 11)?, @@ -960,14 +967,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2020, 1, 11)?, @@ -1003,14 +1010,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2021, 1, 11)?, @@ -1050,14 +1057,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2022, 1, 11)?, @@ -1096,14 +1103,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2023, 1, 11)?, @@ -1143,14 +1150,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2024, 1, 11)?, @@ -1194,14 +1201,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2025, 1, 11)?, @@ -1245,14 +1252,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2026, 1, 11)?, @@ -1296,14 +1303,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2027, 1, 11)?, @@ -1343,14 +1350,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2028, 1, 11)?, @@ -1394,14 +1401,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2029, 1, 11)?, @@ -1445,14 +1452,14 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "رأس السنة الميلادية"), ( NaiveDate::from_ymd_res(2030, 1, 11)?, @@ -1496,8 +1503,8 @@ pub fn build( ), ], &mut map, - Country::MA, - "Morocco", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/md.rs b/src/data/md.rs index ad9e037..3784c3e 100644 --- a/src/data/md.rs +++ b/src/data/md.rs @@ -1,17 +1,24 @@ //! Moldova +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Moldova"; +const COUNTY_CODE: Country = Country::MD; + /// Generate holiday map for Moldova. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2000, 1, 7)?, @@ -42,14 +49,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2001, 1, 7)?, @@ -81,14 +88,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2002, 1, 7)?, @@ -120,14 +127,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2003, 1, 7)?, @@ -159,14 +166,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2004, 1, 7)?, @@ -198,34 +205,33 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( - years, - 2005, - vec![ - - (NaiveDate::from_ymd_res(2005, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2005, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul)"), - (NaiveDate::from_ymd_res(2005, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul)"), - (NaiveDate::from_ymd_res(2005, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2005, 5, 1)?, "Paștele; Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2005, 5, 2)?, "Paștele"), - (NaiveDate::from_ymd_res(2005, 5, 9)?, "Paștele blajinilor; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2005, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2005, 8, 31)?, "Limba noastră"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2005, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul)"), + (NaiveDate::from_ymd_res(2005, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul)"), + (NaiveDate::from_ymd_res(2005, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2005, 5, 1)?, "Paștele; Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2005, 5, 2)?, "Paștele"), + (NaiveDate::from_ymd_res(2005, 5, 9)?, "Paștele blajinilor; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2005, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2005, 8, 31)?, "Limba noastră"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2006, 1, 7)?, @@ -256,14 +262,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2007, 1, 7)?, @@ -295,14 +301,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2008, 1, 7)?, @@ -334,14 +340,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2009, 1, 7)?, @@ -373,14 +379,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2010, 1, 7)?, @@ -412,14 +418,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2011, 1, 7)?, @@ -451,14 +457,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2012, 1, 7)?, @@ -490,14 +496,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 8, 31)?, "Limba noastră"), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2013, 1, 7)?, @@ -533,14 +539,14 @@ pub fn build( ), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2014, 1, 7)?, @@ -576,14 +582,14 @@ pub fn build( ), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Anul Nou"), ( NaiveDate::from_ymd_res(2015, 1, 7)?, @@ -619,367 +625,352 @@ pub fn build( ), ], &mut map, - Country::MD, - "Moldova", + COUNTY_CODE, + COUNTY_NAME, ); build_year( - years, - 2016, - vec![ - - (NaiveDate::from_ymd_res(2016, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2016, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2016, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2016, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2016, 5, 1)?, "Paștele; Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2016, 5, 2)?, "Paștele"), - (NaiveDate::from_ymd_res(2016, 5, 9)?, "Paștele blajinilor; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2016, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2016, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2016, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2016, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2016, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2016, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2016, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2016, 5, 1)?, "Paștele; Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2016, 5, 2)?, "Paștele"), + (NaiveDate::from_ymd_res(2016, 5, 9)?, "Paștele blajinilor; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2016, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2016, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2016, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2016, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2017, - vec![ - - (NaiveDate::from_ymd_res(2017, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2017, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2017, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2017, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2017, 4, 16)?, "Paștele"), - (NaiveDate::from_ymd_res(2017, 4, 17)?, "Paștele"), - (NaiveDate::from_ymd_res(2017, 4, 24)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2017, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2017, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2017, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2017, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2017, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2017, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2017, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2017, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2017, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2017, 4, 16)?, "Paștele"), + (NaiveDate::from_ymd_res(2017, 4, 17)?, "Paștele"), + (NaiveDate::from_ymd_res(2017, 4, 24)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2017, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2017, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2017, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2017, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2017, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2017, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2018, - vec![ - - (NaiveDate::from_ymd_res(2018, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2018, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2018, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2018, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2018, 4, 8)?, "Paștele"), - (NaiveDate::from_ymd_res(2018, 4, 9)?, "Paștele"), - (NaiveDate::from_ymd_res(2018, 4, 16)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2018, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2018, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2018, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2018, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2018, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2018, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2018, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2018, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2018, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2018, 4, 8)?, "Paștele"), + (NaiveDate::from_ymd_res(2018, 4, 9)?, "Paștele"), + (NaiveDate::from_ymd_res(2018, 4, 16)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2018, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2018, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2018, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2018, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2018, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2018, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2019, - vec![ - - (NaiveDate::from_ymd_res(2019, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2019, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2019, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2019, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2019, 4, 28)?, "Paștele"), - (NaiveDate::from_ymd_res(2019, 4, 29)?, "Paștele"), - (NaiveDate::from_ymd_res(2019, 5, 6)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2019, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2019, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2019, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2019, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2019, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2019, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2019, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2019, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2019, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2019, 4, 28)?, "Paștele"), + (NaiveDate::from_ymd_res(2019, 4, 29)?, "Paștele"), + (NaiveDate::from_ymd_res(2019, 5, 6)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2019, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2019, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2019, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2019, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2019, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2019, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2020, - vec![ - - (NaiveDate::from_ymd_res(2020, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2020, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2020, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2020, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2020, 4, 19)?, "Paștele"), - (NaiveDate::from_ymd_res(2020, 4, 20)?, "Paștele"), - (NaiveDate::from_ymd_res(2020, 4, 27)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2020, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2020, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2020, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2020, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2020, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2020, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2020, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2020, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2020, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2020, 4, 19)?, "Paștele"), + (NaiveDate::from_ymd_res(2020, 4, 20)?, "Paștele"), + (NaiveDate::from_ymd_res(2020, 4, 27)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2020, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2020, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2020, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2020, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2020, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2020, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2021, - vec![ - - (NaiveDate::from_ymd_res(2021, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2021, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2021, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2021, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2021, 5, 2)?, "Paștele"), - (NaiveDate::from_ymd_res(2021, 5, 3)?, "Paștele"), - (NaiveDate::from_ymd_res(2021, 5, 10)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2021, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2021, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2021, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2021, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2021, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2021, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2021, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2021, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2021, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2021, 5, 2)?, "Paștele"), + (NaiveDate::from_ymd_res(2021, 5, 3)?, "Paștele"), + (NaiveDate::from_ymd_res(2021, 5, 10)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2021, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2021, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2021, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2021, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2021, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2021, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2022, - vec![ - - (NaiveDate::from_ymd_res(2022, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2022, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2022, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2022, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2022, 4, 24)?, "Paștele"), - (NaiveDate::from_ymd_res(2022, 4, 25)?, "Paștele"), - (NaiveDate::from_ymd_res(2022, 5, 2)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2022, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2022, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2022, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2022, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2022, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2022, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2022, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2022, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2022, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2022, 4, 24)?, "Paștele"), + (NaiveDate::from_ymd_res(2022, 4, 25)?, "Paștele"), + (NaiveDate::from_ymd_res(2022, 5, 2)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2022, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2022, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2022, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2022, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2022, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2022, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2023, - vec![ - - (NaiveDate::from_ymd_res(2023, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2023, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2023, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2023, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2023, 4, 16)?, "Paștele"), - (NaiveDate::from_ymd_res(2023, 4, 17)?, "Paștele"), - (NaiveDate::from_ymd_res(2023, 4, 24)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2023, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2023, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2023, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2023, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2023, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2023, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2023, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2023, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2023, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2023, 4, 16)?, "Paștele"), + (NaiveDate::from_ymd_res(2023, 4, 17)?, "Paștele"), + (NaiveDate::from_ymd_res(2023, 4, 24)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2023, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2023, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2023, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2023, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2023, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2023, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2024, - vec![ - - (NaiveDate::from_ymd_res(2024, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2024, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2024, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2024, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2024, 5, 5)?, "Paștele"), - (NaiveDate::from_ymd_res(2024, 5, 6)?, "Paștele"), - (NaiveDate::from_ymd_res(2024, 5, 13)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2024, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2024, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2024, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2024, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2024, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2024, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2024, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2024, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2024, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2024, 5, 5)?, "Paștele"), + (NaiveDate::from_ymd_res(2024, 5, 6)?, "Paștele"), + (NaiveDate::from_ymd_res(2024, 5, 13)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2024, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2024, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2024, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2024, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2024, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2024, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2025, - vec![ - - (NaiveDate::from_ymd_res(2025, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2025, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2025, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2025, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2025, 4, 20)?, "Paștele"), - (NaiveDate::from_ymd_res(2025, 4, 21)?, "Paștele"), - (NaiveDate::from_ymd_res(2025, 4, 28)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2025, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2025, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2025, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2025, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2025, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2025, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2025, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2025, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2025, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2025, 4, 20)?, "Paștele"), + (NaiveDate::from_ymd_res(2025, 4, 21)?, "Paștele"), + (NaiveDate::from_ymd_res(2025, 4, 28)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2025, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2025, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2025, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2025, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2025, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2025, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2026, - vec![ - - (NaiveDate::from_ymd_res(2026, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2026, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2026, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2026, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2026, 4, 12)?, "Paștele"), - (NaiveDate::from_ymd_res(2026, 4, 13)?, "Paștele"), - (NaiveDate::from_ymd_res(2026, 4, 20)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2026, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2026, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2026, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2026, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2026, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2026, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2026, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2026, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2026, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2026, 4, 12)?, "Paștele"), + (NaiveDate::from_ymd_res(2026, 4, 13)?, "Paștele"), + (NaiveDate::from_ymd_res(2026, 4, 20)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2026, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2026, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2026, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2026, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2026, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2026, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2027, - vec![ - - (NaiveDate::from_ymd_res(2027, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2027, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2027, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2027, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2027, 5, 2)?, "Paștele"), - (NaiveDate::from_ymd_res(2027, 5, 3)?, "Paștele"), - (NaiveDate::from_ymd_res(2027, 5, 10)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2027, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2027, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2027, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2027, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2027, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2027, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2027, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2027, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2027, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2027, 5, 2)?, "Paștele"), + (NaiveDate::from_ymd_res(2027, 5, 3)?, "Paștele"), + (NaiveDate::from_ymd_res(2027, 5, 10)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2027, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2027, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2027, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2027, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2027, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2027, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2028, - vec![ - - (NaiveDate::from_ymd_res(2028, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2028, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2028, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2028, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2028, 4, 16)?, "Paștele"), - (NaiveDate::from_ymd_res(2028, 4, 17)?, "Paștele"), - (NaiveDate::from_ymd_res(2028, 4, 24)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2028, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2028, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2028, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2028, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2028, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2028, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2028, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2028, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2028, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2028, 4, 16)?, "Paștele"), + (NaiveDate::from_ymd_res(2028, 4, 17)?, "Paștele"), + (NaiveDate::from_ymd_res(2028, 4, 24)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2028, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2028, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2028, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2028, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2028, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2028, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2029, - vec![ - - (NaiveDate::from_ymd_res(2029, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2029, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2029, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2029, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2029, 4, 8)?, "Paștele"), - (NaiveDate::from_ymd_res(2029, 4, 9)?, "Paștele"), - (NaiveDate::from_ymd_res(2029, 4, 16)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2029, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2029, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2029, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2029, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2029, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2029, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2029, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2029, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2029, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2029, 4, 8)?, "Paștele"), + (NaiveDate::from_ymd_res(2029, 4, 9)?, "Paștele"), + (NaiveDate::from_ymd_res(2029, 4, 16)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2029, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2029, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2029, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2029, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2029, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2029, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); build_year( - years, - 2030, - vec![ - - (NaiveDate::from_ymd_res(2030, 1, 1)?, "Anul Nou"), - (NaiveDate::from_ymd_res(2030, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2030, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), - (NaiveDate::from_ymd_res(2030, 3, 8)?, "Ziua internatională a femeii"), - (NaiveDate::from_ymd_res(2030, 4, 28)?, "Paștele"), - (NaiveDate::from_ymd_res(2030, 4, 29)?, "Paștele"), - (NaiveDate::from_ymd_res(2030, 5, 6)?, "Paștele blajinilor"), - (NaiveDate::from_ymd_res(2030, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), - (NaiveDate::from_ymd_res(2030, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), - (NaiveDate::from_ymd_res(2030, 6, 1)?, "Ziua Ocrotirii Copilului"), - (NaiveDate::from_ymd_res(2030, 8, 27)?, "Ziua independenţei Republicii Moldova"), - (NaiveDate::from_ymd_res(2030, 8, 31)?, "Limba noastră"), - (NaiveDate::from_ymd_res(2030, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), - ], - &mut map, - Country::MD, - "Moldova", - ); + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 1)?, "Anul Nou"), + (NaiveDate::from_ymd_res(2030, 1, 7)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2030, 1, 8)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil vechi)"), + (NaiveDate::from_ymd_res(2030, 3, 8)?, "Ziua internatională a femeii"), + (NaiveDate::from_ymd_res(2030, 4, 28)?, "Paștele"), + (NaiveDate::from_ymd_res(2030, 4, 29)?, "Paștele"), + (NaiveDate::from_ymd_res(2030, 5, 6)?, "Paștele blajinilor"), + (NaiveDate::from_ymd_res(2030, 5, 1)?, "Ziua internaţională a solidarităţii oamenilor muncii"), + (NaiveDate::from_ymd_res(2030, 5, 9)?, "Ziua Europei; Ziua Victoriei și a comemorării eroilor căzuţi pentru Independenţa Patriei"), + (NaiveDate::from_ymd_res(2030, 6, 1)?, "Ziua Ocrotirii Copilului"), + (NaiveDate::from_ymd_res(2030, 8, 27)?, "Ziua independenţei Republicii Moldova"), + (NaiveDate::from_ymd_res(2030, 8, 31)?, "Limba noastră"), + (NaiveDate::from_ymd_res(2030, 12, 25)?, "Nașterea lui Iisus Hristos (Crăciunul pe stil nou)"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); Ok(map) } diff --git a/src/data/mg.rs b/src/data/mg.rs index c2c87e7..6d80fc1 100644 --- a/src/data/mg.rs +++ b/src/data/mg.rs @@ -1,17 +1,24 @@ //! Madagascar +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Madagascar"; +const COUNTY_CODE: Country = Country::MG; + /// Generate holiday map for Madagascar. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2000, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2000, 3, 29)?, "Fetin'ny mahery fo"), @@ -41,14 +48,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2001, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2001, 3, 29)?, "Fetin'ny mahery fo"), @@ -78,14 +85,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2002, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Fetin'ny mahery fo"), @@ -115,14 +122,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2003, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2003, 3, 29)?, "Fetin'ny mahery fo"), @@ -152,14 +159,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2004, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2004, 3, 29)?, "Fetin'ny mahery fo"), @@ -189,14 +196,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2005, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2005, 3, 29)?, "Fetin'ny mahery fo"), @@ -226,14 +233,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2006, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2006, 3, 29)?, "Fetin'ny mahery fo"), @@ -263,14 +270,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2007, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2007, 3, 29)?, "Fetin'ny mahery fo"), @@ -300,14 +307,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2008, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2008, 3, 29)?, "Fetin'ny mahery fo"), @@ -336,14 +343,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2009, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2009, 3, 29)?, "Fetin'ny mahery fo"), @@ -373,14 +380,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2010, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2010, 3, 29)?, "Fetin'ny mahery fo"), @@ -410,14 +417,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2011, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2011, 3, 29)?, "Fetin'ny mahery fo"), @@ -448,14 +455,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2012, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2012, 3, 29)?, "Fetin'ny mahery fo"), @@ -486,14 +493,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2013, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Fetin'ny mahery fo"), @@ -524,14 +531,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2014, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2014, 3, 29)?, "Fetin'ny mahery fo"), @@ -562,14 +569,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2015, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2015, 3, 29)?, "Fetin'ny mahery fo"), @@ -600,14 +607,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2016, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2016, 3, 29)?, "Fetin'ny mahery fo"), @@ -638,14 +645,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2017, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2017, 3, 29)?, "Fetin'ny mahery fo"), @@ -676,14 +683,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2018, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2018, 3, 29)?, "Fetin'ny mahery fo"), @@ -714,14 +721,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2019, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2019, 3, 29)?, "Fetin'ny mahery fo"), @@ -752,14 +759,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2020, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2020, 3, 29)?, "Fetin'ny mahery fo"), @@ -790,14 +797,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2021, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2021, 3, 29)?, "Fetin'ny mahery fo"), @@ -828,14 +835,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2022, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2022, 3, 29)?, "Fetin'ny mahery fo"), @@ -866,14 +873,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2023, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2023, 3, 29)?, "Fetin'ny mahery fo"), @@ -904,14 +911,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2024, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Fetin'ny mahery fo"), @@ -942,14 +949,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2025, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2025, 3, 29)?, "Fetin'ny mahery fo"), @@ -980,14 +987,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2026, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2026, 3, 29)?, "Fetin'ny mahery fo"), @@ -1018,14 +1025,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2027, 3, 8)?, "Fetin'ny vehivavy"), ( @@ -1058,14 +1065,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2028, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2028, 3, 29)?, "Fetin'ny mahery fo"), @@ -1096,14 +1103,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2029, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2029, 3, 29)?, "Fetin'ny mahery fo"), @@ -1134,14 +1141,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Taom-baovao"), (NaiveDate::from_ymd_res(2030, 3, 8)?, "Fetin'ny vehivavy"), (NaiveDate::from_ymd_res(2030, 3, 29)?, "Fetin'ny mahery fo"), @@ -1172,8 +1179,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Fetin'ny noely"), ], &mut map, - Country::MG, - "Madagascar", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/mk.rs b/src/data/mk.rs index e3d2238..1014715 100644 --- a/src/data/mk.rs +++ b/src/data/mk.rs @@ -1,17 +1,24 @@ //! North Macedonia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "North Macedonia"; +const COUNTY_CODE: Country = Country::MK; + /// Generate holiday map for North Macedonia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2000, 1, 7)?, @@ -49,14 +56,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2001, 1, 7)?, @@ -91,14 +98,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2002, 1, 7)?, @@ -133,14 +140,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2003, 1, 7)?, @@ -175,14 +182,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2004, 1, 7)?, @@ -217,14 +224,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2005, 1, 7)?, @@ -259,14 +266,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 7)?, @@ -297,14 +304,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2007, 1, 7)?, @@ -339,14 +346,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2008, 1, 7)?, @@ -381,14 +388,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2009, 1, 7)?, @@ -423,14 +430,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2010, 1, 7)?, @@ -465,14 +472,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2011, 1, 7)?, @@ -507,14 +514,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 7)?, @@ -549,14 +556,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2013, 1, 7)?, @@ -591,14 +598,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2014, 1, 7)?, @@ -633,14 +640,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2015, 1, 7)?, @@ -675,14 +682,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2016, 1, 7)?, @@ -717,14 +724,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 7)?, @@ -759,14 +766,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2018, 1, 7)?, @@ -801,14 +808,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2019, 1, 7)?, @@ -843,14 +850,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2020, 1, 7)?, @@ -881,14 +888,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2021, 1, 7)?, @@ -923,14 +930,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2022, 1, 7)?, @@ -965,14 +972,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 7)?, @@ -1007,14 +1014,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2024, 1, 7)?, @@ -1049,14 +1056,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2025, 1, 7)?, @@ -1091,14 +1098,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2026, 1, 7)?, @@ -1133,14 +1140,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2027, 1, 7)?, @@ -1175,14 +1182,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 1, 7)?, @@ -1217,14 +1224,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2029, 1, 7)?, @@ -1259,14 +1266,14 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2030, 1, 7)?, @@ -1301,8 +1308,8 @@ pub fn build( ), ], &mut map, - Country::MK, - "North Macedonia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/mod.rs b/src/data/mod.rs index 409a065..77f5c63 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -1,10 +1,9 @@ -mod helper; +pub(super) mod helper; -use crate::{prelude::*, Holiday, NaiveDateExt, Result, Year}; +use crate::{prelude::*, HolidayPerYearMap, NaiveDateExt, Result, Year}; use helper::build_year; use chrono::NaiveDate; -use std::collections::BTreeMap; use std::collections::HashMap; #[cfg(feature = "AO")] @@ -112,6 +111,57 @@ pub mod ge; #[cfg(feature = "DE")] pub mod de; +#[cfg(feature = "DE")] +pub mod de_bb; + +#[cfg(feature = "DE")] +pub mod de_be; + +#[cfg(feature = "DE")] +pub mod de_bw; + +#[cfg(feature = "DE")] +pub mod de_by; + +#[cfg(feature = "DE")] +pub mod de_byp; + +#[cfg(feature = "DE")] +pub mod de_hb; + +#[cfg(feature = "DE")] +pub mod de_he; + +#[cfg(feature = "DE")] +pub mod de_hh; + +#[cfg(feature = "DE")] +pub mod de_mv; + +#[cfg(feature = "DE")] +pub mod de_ni; + +#[cfg(feature = "DE")] +pub mod de_nw; + +#[cfg(feature = "DE")] +pub mod de_rp; + +#[cfg(feature = "DE")] +pub mod de_sh; + +#[cfg(feature = "DE")] +pub mod de_sl; + +#[cfg(feature = "DE")] +pub mod de_sn; + +#[cfg(feature = "DE")] +pub mod de_st; + +#[cfg(feature = "DE")] +pub mod de_th; + #[cfg(feature = "GR")] pub mod gr; @@ -292,6 +342,177 @@ pub mod gb; #[cfg(feature = "US")] pub mod us; +#[cfg(feature = "US")] +pub mod us_ak; + +#[cfg(feature = "US")] +pub mod us_al; + +#[cfg(feature = "US")] +pub mod us_ar; + +#[cfg(feature = "US")] +pub mod us_as; + +#[cfg(feature = "US")] +pub mod us_az; + +#[cfg(feature = "US")] +pub mod us_ca; + +#[cfg(feature = "US")] +pub mod us_co; + +#[cfg(feature = "US")] +pub mod us_ct; + +#[cfg(feature = "US")] +pub mod us_dc; + +#[cfg(feature = "US")] +pub mod us_de; + +#[cfg(feature = "US")] +pub mod us_fl; + +#[cfg(feature = "US")] +pub mod us_ga; + +#[cfg(feature = "US")] +pub mod us_gu; + +#[cfg(feature = "US")] +pub mod us_hi; + +#[cfg(feature = "US")] +pub mod us_ia; + +#[cfg(feature = "US")] +pub mod us_id; + +#[cfg(feature = "US")] +pub mod us_il; + +#[cfg(feature = "US")] +pub mod us_in; + +#[cfg(feature = "US")] +pub mod us_ks; + +#[cfg(feature = "US")] +pub mod us_ky; + +#[cfg(feature = "US")] +pub mod us_la; + +#[cfg(feature = "US")] +pub mod us_ma; + +#[cfg(feature = "US")] +pub mod us_md; + +#[cfg(feature = "US")] +pub mod us_me; + +#[cfg(feature = "US")] +pub mod us_mi; + +#[cfg(feature = "US")] +pub mod us_mn; + +#[cfg(feature = "US")] +pub mod us_mo; + +#[cfg(feature = "US")] +pub mod us_mp; + +#[cfg(feature = "US")] +pub mod us_ms; + +#[cfg(feature = "US")] +pub mod us_mt; + +#[cfg(feature = "US")] +pub mod us_nc; + +#[cfg(feature = "US")] +pub mod us_nd; + +#[cfg(feature = "US")] +pub mod us_ne; + +#[cfg(feature = "US")] +pub mod us_nh; + +#[cfg(feature = "US")] +pub mod us_nj; + +#[cfg(feature = "US")] +pub mod us_nm; + +#[cfg(feature = "US")] +pub mod us_nv; + +#[cfg(feature = "US")] +pub mod us_ny; + +#[cfg(feature = "US")] +pub mod us_oh; + +#[cfg(feature = "US")] +pub mod us_ok; + +#[cfg(feature = "US")] +pub mod us_or; + +#[cfg(feature = "US")] +pub mod us_pa; + +#[cfg(feature = "US")] +pub mod us_pr; + +#[cfg(feature = "US")] +pub mod us_ri; + +#[cfg(feature = "US")] +pub mod us_sc; + +#[cfg(feature = "US")] +pub mod us_sd; + +#[cfg(feature = "US")] +pub mod us_tn; + +#[cfg(feature = "US")] +pub mod us_tx; + +#[cfg(feature = "US")] +pub mod us_um; + +#[cfg(feature = "US")] +pub mod us_ut; + +#[cfg(feature = "US")] +pub mod us_va; + +#[cfg(feature = "US")] +pub mod us_vi; + +#[cfg(feature = "US")] +pub mod us_vt; + +#[cfg(feature = "US")] +pub mod us_wa; + +#[cfg(feature = "US")] +pub mod us_wi; + +#[cfg(feature = "US")] +pub mod us_wv; + +#[cfg(feature = "US")] +pub mod us_wy; + #[cfg(feature = "UY")] pub mod uy; diff --git a/src/data/mt.rs b/src/data/mt.rs index ab6660c..cc85b1b 100644 --- a/src/data/mt.rs +++ b/src/data/mt.rs @@ -1,17 +1,24 @@ //! Malta +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Malta"; +const COUNTY_CODE: Country = Country::MT; + /// Generate holiday map for Malta. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2000, 2, 10)?, @@ -43,14 +50,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2001, 2, 10)?, @@ -82,14 +89,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2002, 2, 10)?, @@ -121,14 +128,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2003, 2, 10)?, @@ -160,14 +167,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2004, 2, 10)?, @@ -199,14 +206,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2005, 2, 10)?, @@ -238,14 +245,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2006, 2, 10)?, @@ -277,14 +284,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2007, 2, 10)?, @@ -316,14 +323,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2008, 2, 10)?, @@ -355,14 +362,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2009, 2, 10)?, @@ -394,14 +401,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2010, 2, 10)?, @@ -433,14 +440,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2011, 2, 10)?, @@ -472,14 +479,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2012, 2, 10)?, @@ -511,14 +518,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2013, 2, 10)?, @@ -550,14 +557,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2014, 2, 10)?, @@ -589,14 +596,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2015, 2, 10)?, @@ -628,14 +635,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2016, 2, 10)?, @@ -667,14 +674,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2017, 2, 10)?, @@ -706,14 +713,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2018, 2, 10)?, @@ -745,14 +752,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2019, 2, 10)?, @@ -784,14 +791,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2020, 2, 10)?, @@ -823,14 +830,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2021, 2, 10)?, @@ -862,14 +869,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2022, 2, 10)?, @@ -901,14 +908,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2023, 2, 10)?, @@ -940,14 +947,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2024, 2, 10)?, @@ -979,14 +986,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2025, 2, 10)?, @@ -1018,14 +1025,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2026, 2, 10)?, @@ -1057,14 +1064,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2027, 2, 10)?, @@ -1096,14 +1103,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2028, 2, 10)?, @@ -1135,14 +1142,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2029, 2, 10)?, @@ -1174,14 +1181,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "L-Ewwel tas-Sena"), ( NaiveDate::from_ymd_res(2030, 2, 10)?, @@ -1213,8 +1220,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Il-Milied"), ], &mut map, - Country::MT, - "Malta", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/mw.rs b/src/data/mw.rs index f7c23cf..858651a 100644 --- a/src/data/mw.rs +++ b/src/data/mw.rs @@ -1,17 +1,24 @@ //! Malawi +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Malawi"; +const COUNTY_CODE: Country = Country::MW; + /// Generate holiday map for Malawi. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2000, 1, 3)?, @@ -41,14 +48,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2001, 3, 3)?, "Martyrs Day"), @@ -66,14 +73,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2002, 3, 3)?, "Martyrs Day"), @@ -95,14 +102,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2003, 3, 3)?, "Martyrs Day"), @@ -120,14 +127,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2004, 3, 3)?, "Martyrs Day"), @@ -153,14 +160,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2005, 1, 3)?, @@ -198,14 +205,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -235,14 +242,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2007, 3, 3)?, "Martyrs Day"), @@ -260,14 +267,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2008, 3, 3)?, "Martyrs Day"), @@ -285,14 +292,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2009, 3, 3)?, "Martyrs Day"), @@ -310,14 +317,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2010, 3, 3)?, "Martyrs Day"), @@ -343,14 +350,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2011, 1, 3)?, @@ -388,14 +395,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -421,14 +428,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2013, 3, 3)?, "Martyrs Day"), @@ -450,14 +457,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2014, 3, 3)?, "Martyrs Day"), @@ -475,14 +482,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2015, 3, 3)?, "Martyrs Day"), @@ -500,14 +507,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2016, 3, 3)?, "Martyrs Day"), @@ -537,14 +544,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -574,14 +581,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2018, 3, 3)?, "Martyrs Day"), @@ -599,14 +606,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2019, 3, 3)?, "Martyrs Day"), @@ -628,14 +635,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2020, 3, 3)?, "Martyrs Day"), @@ -653,14 +660,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2021, 3, 3)?, "Martyrs Day"), @@ -686,14 +693,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2022, 1, 3)?, @@ -731,14 +738,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -768,14 +775,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2024, 3, 3)?, "Martyrs Day"), @@ -797,14 +804,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2025, 3, 3)?, "Martyrs Day"), @@ -822,14 +829,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2026, 3, 3)?, "Martyrs Day"), @@ -847,14 +854,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2027, 3, 3)?, "Martyrs Day"), @@ -880,14 +887,14 @@ pub fn build( ), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 1, 3)?, @@ -917,14 +924,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2029, 3, 3)?, "Martyrs Day"), @@ -942,14 +949,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 1, 15)?, "John Chilembwe Day"), (NaiveDate::from_ymd_res(2030, 3, 3)?, "Martyrs Day"), @@ -971,8 +978,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::MW, - "Malawi", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/mx.rs b/src/data/mx.rs index 8791f33..0773be1 100644 --- a/src/data/mx.rs +++ b/src/data/mx.rs @@ -1,17 +1,24 @@ //! Mexico +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Mexico"; +const COUNTY_CODE: Country = Country::MX; + /// Generate holiday map for Mexico. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2000, 2, 5)?, @@ -37,14 +44,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2001, 2, 5)?, @@ -66,14 +73,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2002, 2, 5)?, @@ -95,14 +102,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2003, 2, 5)?, @@ -124,14 +131,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2004, 2, 5)?, @@ -153,14 +160,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2005, 2, 5)?, @@ -182,14 +189,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2006, 2, 6)?, @@ -215,14 +222,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2007, 2, 5)?, @@ -244,14 +251,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2008, 2, 4)?, @@ -273,14 +280,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2009, 2, 2)?, @@ -302,14 +309,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2010, 2, 1)?, @@ -331,14 +338,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2011, 2, 7)?, @@ -360,14 +367,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2012, 2, 6)?, @@ -393,14 +400,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2013, 2, 4)?, @@ -422,14 +429,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2014, 2, 3)?, @@ -451,14 +458,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2015, 2, 2)?, @@ -480,14 +487,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2016, 2, 1)?, @@ -509,14 +516,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2017, 2, 6)?, @@ -538,14 +545,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2018, 2, 5)?, @@ -571,14 +578,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2019, 2, 4)?, @@ -600,14 +607,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2020, 2, 3)?, @@ -629,14 +636,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2021, 2, 1)?, @@ -658,14 +665,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2022, 2, 7)?, @@ -687,14 +694,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2023, 2, 6)?, @@ -716,14 +723,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2024, 2, 5)?, @@ -749,14 +756,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2025, 2, 3)?, @@ -778,14 +785,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2026, 2, 2)?, @@ -807,14 +814,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2027, 2, 1)?, @@ -836,14 +843,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2028, 2, 7)?, @@ -865,14 +872,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2029, 2, 5)?, @@ -894,14 +901,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2030, 2, 4)?, @@ -927,8 +934,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Navidad"), ], &mut map, - Country::MX, - "Mexico", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/my.rs b/src/data/my.rs index 3684812..3d00e3c 100644 --- a/src/data/my.rs +++ b/src/data/my.rs @@ -1,17 +1,24 @@ //! Malaysia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Malaysia"; +const COUNTY_CODE: Country = Country::MY; + /// Generate holiday map for Malaysia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 2, 5)?, "Tahun Baharu Cina (anggaran)", @@ -69,14 +76,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 24)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2001, 1, 25)?, @@ -103,14 +110,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 3, 6)?, "Hari Raya Qurban"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 2, 12)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2002, 2, 13)?, @@ -137,14 +144,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 2, 23)?, "Hari Raya Qurban"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 2, 1)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2003, 2, 2)?, @@ -176,14 +183,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 9, 1)?, "Cuti Hari Kebangsaan"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 22)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2004, 1, 23)?, @@ -218,14 +225,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 2, 9)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2005, 2, 10)?, @@ -254,14 +261,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Cuti Hari Krismas"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 29)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2006, 1, 30)?, @@ -293,14 +300,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 2, 18)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2007, 2, 19)?, @@ -337,14 +344,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 2, 7)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2008, 2, 8)?, @@ -373,14 +380,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 9, 1)?, "Cuti Hari Kebangsaan"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 26)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2009, 1, 27)?, @@ -411,14 +418,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 2, 14)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2010, 2, 15)?, @@ -450,14 +457,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 2, 3)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2011, 2, 4)?, @@ -489,14 +496,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Cuti Hari Krismas"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 23)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2012, 1, 24)?, @@ -533,14 +540,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 9, 17)?, "Cuti Hari Malaysia"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 2, 10)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2013, 2, 11)?, @@ -572,14 +579,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 31)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2014, 2, 1)?, @@ -612,14 +619,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 2, 19)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2015, 2, 20)?, @@ -652,14 +659,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 5, 4)?, "Cuti Hari Wesak"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 2, 8)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2016, 2, 9)?, @@ -689,14 +696,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Cuti Hari Krismas"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 28)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2017, 1, 29)?, @@ -740,14 +747,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 2, 16)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2018, 2, 17)?, @@ -784,14 +791,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 9, 17)?, "Cuti Hari Malaysia"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 2, 5)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2019, 2, 6)?, @@ -828,14 +835,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 25)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2020, 1, 26)?, @@ -871,14 +878,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 2, 12)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2021, 2, 13)?, @@ -906,14 +913,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 7, 20)?, "Hari Raya Qurban"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 2, 1)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2022, 2, 2)?, @@ -957,14 +964,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Cuti Hari Krismas"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 22)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2023, 1, 23)?, @@ -1004,14 +1011,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 2, 10)?, "Tahun Baharu Cina"), ( NaiveDate::from_ymd_res(2024, 2, 11)?, @@ -1042,14 +1049,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 29)?, "Tahun Baharu Cina (anggaran)", @@ -1101,14 +1108,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 9, 1)?, "Cuti Hari Kebangsaan"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 2, 17)?, "Tahun Baharu Cina (anggaran)", @@ -1150,14 +1157,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 2, 6)?, "Tahun Baharu Cina (anggaran)", @@ -1208,14 +1215,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 26)?, "Tahun Baharu Cina (anggaran)", @@ -1262,14 +1269,14 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 2, 13)?, "Tahun Baharu Cina (anggaran)", @@ -1313,14 +1320,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 9, 17)?, "Cuti Hari Malaysia"), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 2, 3)?, "Tahun Baharu Cina (anggaran)", @@ -1363,8 +1370,8 @@ pub fn build( ), ], &mut map, - Country::MY, - "Malaysia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/mz.rs b/src/data/mz.rs index 6947640..b75c403 100644 --- a/src/data/mz.rs +++ b/src/data/mz.rs @@ -1,17 +1,24 @@ //! Mozambique +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Mozambique"; +const COUNTY_CODE: Country = Country::MZ; + /// Generate holiday map for Mozambique. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 1)?, "Dia da Fraternidade universal", @@ -48,14 +55,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 1)?, "Dia da Fraternidade universal", @@ -88,14 +95,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 1)?, "Dia da Fraternidade universal", @@ -136,14 +143,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 1)?, "Dia da Fraternidade universal", @@ -180,14 +187,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 1)?, "Dia da Fraternidade universal", @@ -220,14 +227,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 1)?, "Dia da Fraternidade universal", @@ -272,14 +279,14 @@ pub fn build( ), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 1)?, "Dia da Fraternidade universal", @@ -320,14 +327,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Dia da Fraternidade universal", @@ -360,14 +367,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 1)?, "Dia da Fraternidade universal", @@ -408,14 +415,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 1)?, "Dia da Fraternidade universal", @@ -452,14 +459,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 1)?, "Dia da Fraternidade universal", @@ -492,14 +499,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 1)?, "Dia da Fraternidade universal", @@ -544,14 +551,14 @@ pub fn build( ), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 1)?, "Dia da Fraternidade universal", @@ -588,14 +595,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 1)?, "Dia da Fraternidade universal", @@ -636,14 +643,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 1)?, "Dia da Fraternidade universal", @@ -680,14 +687,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 1, 1)?, "Dia da Fraternidade universal", @@ -724,14 +731,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 1)?, "Dia da Fraternidade universal", @@ -776,14 +783,14 @@ pub fn build( ), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 1)?, "Dia da Fraternidade universal", @@ -824,14 +831,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 1)?, "Dia da Fraternidade universal", @@ -864,14 +871,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 1)?, "Dia da Fraternidade universal", @@ -912,14 +919,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 1)?, "Dia da Fraternidade universal", @@ -956,14 +963,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 1)?, "Dia da Fraternidade universal", @@ -996,14 +1003,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 1)?, "Dia da Fraternidade universal", @@ -1048,14 +1055,14 @@ pub fn build( ), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 1)?, "Dia da Fraternidade universal", @@ -1096,14 +1103,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 1)?, "Dia da Fraternidade universal", @@ -1140,14 +1147,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 1)?, "Dia da Fraternidade universal", @@ -1184,14 +1191,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 1)?, "Dia da Fraternidade universal", @@ -1228,14 +1235,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 1)?, "Dia da Fraternidade universal", @@ -1268,14 +1275,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 1)?, "Dia da Fraternidade universal", @@ -1312,14 +1319,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 1)?, "Dia da Fraternidade universal", @@ -1352,14 +1359,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 1)?, "Dia da Fraternidade universal", @@ -1400,8 +1407,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Dia da Família"), ], &mut map, - Country::MZ, - "Mozambique", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/na.rs b/src/data/na.rs index 2f943fd..9c5d645 100644 --- a/src/data/na.rs +++ b/src/data/na.rs @@ -1,17 +1,24 @@ //! Namibia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Namibia"; +const COUNTY_CODE: Country = Country::NA; + /// Generate holiday map for Namibia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), @@ -34,14 +41,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 1, 3)?, "Y2K changeover"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), @@ -63,14 +70,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), @@ -88,14 +95,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), @@ -121,14 +128,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 3, 21)?, "Independence Day"), ( @@ -154,14 +161,14 @@ pub fn build( ), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), @@ -183,14 +190,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -218,14 +225,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), @@ -247,14 +254,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2008, 3, 21)?, @@ -284,14 +291,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), @@ -309,14 +316,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 3, 21)?, "Independence Day"), ( @@ -342,14 +349,14 @@ pub fn build( ), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), @@ -371,14 +378,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -404,14 +411,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), @@ -429,14 +436,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), @@ -462,14 +469,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), @@ -487,14 +494,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), @@ -516,14 +523,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -551,14 +558,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), @@ -580,14 +587,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), @@ -605,14 +612,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), @@ -630,14 +637,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 3, 21)?, "Independence Day"), ( @@ -663,14 +670,14 @@ pub fn build( ), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), @@ -692,14 +699,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -725,14 +732,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), @@ -750,14 +757,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), @@ -783,14 +790,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), @@ -808,14 +815,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 3, 21)?, "Independence Day"), ( @@ -841,14 +848,14 @@ pub fn build( ), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), @@ -872,14 +879,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), @@ -901,14 +908,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 3, 21)?, "Independence Day"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), @@ -926,8 +933,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Family Day"), ], &mut map, - Country::NA, - "Namibia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ng.rs b/src/data/ng.rs index 0627379..2c7e77d 100644 --- a/src/data/ng.rs +++ b/src/data/ng.rs @@ -1,17 +1,24 @@ //! Nigeria +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Nigeria"; +const COUNTY_CODE: Country = Country::NG; + /// Generate holiday map for Nigeria. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Easter Monday"), @@ -50,14 +57,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Easter Monday"), @@ -88,14 +95,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Easter Monday"), @@ -126,14 +133,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Easter Monday"), @@ -164,14 +171,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Easter Monday"), @@ -201,14 +208,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Easter Monday"), @@ -239,14 +246,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Easter Monday"), @@ -281,14 +288,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Eid-el-Kabir Holiday (estimated); New Year's Day", @@ -322,14 +329,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Easter Monday"), @@ -359,14 +366,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Easter Monday"), @@ -397,14 +404,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Easter Monday"), @@ -435,14 +442,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Easter Monday"), @@ -473,14 +480,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Easter Monday"), @@ -511,14 +518,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Easter Monday"), @@ -549,14 +556,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Easter Monday"), @@ -587,14 +594,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Easter Monday"), @@ -629,14 +636,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Easter Monday"), @@ -691,14 +698,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Easter Monday"), @@ -745,14 +752,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Easter Monday"), @@ -787,14 +794,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Easter Monday"), @@ -841,14 +848,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Easter Monday"), @@ -891,14 +898,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Easter Monday"), @@ -945,14 +952,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Easter Monday"), @@ -1015,14 +1022,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), (NaiveDate::from_ymd_res(2023, 4, 10)?, "Easter Monday"), @@ -1065,14 +1072,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Easter Monday"), @@ -1111,14 +1118,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Easter Monday"), @@ -1157,14 +1164,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Easter Monday"), @@ -1203,14 +1210,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Easter Monday"), @@ -1265,14 +1272,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Easter Monday"), @@ -1323,14 +1330,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Easter Monday"), @@ -1361,14 +1368,14 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Easter Monday"), @@ -1411,8 +1418,8 @@ pub fn build( ), ], &mut map, - Country::NG, - "Nigeria", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ni.rs b/src/data/ni.rs index ab837ac..c7bcb86 100644 --- a/src/data/ni.rs +++ b/src/data/ni.rs @@ -1,17 +1,24 @@ //! Nicaragua +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Nicaragua"; +const COUNTY_CODE: Country = Country::NI; + /// Generate holiday map for Nicaragua. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2000, 4, 20)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Viernes Santo"), @@ -40,14 +47,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2001, 4, 12)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Viernes Santo"), @@ -76,14 +83,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2002, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Viernes Santo"), @@ -112,14 +119,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2003, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Viernes Santo"), @@ -148,14 +155,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2004, 4, 8)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Viernes Santo"), @@ -184,14 +191,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2005, 3, 24)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Viernes Santo"), @@ -220,14 +227,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2006, 4, 13)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Viernes Santo"), @@ -256,14 +263,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2007, 4, 5)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Viernes Santo"), @@ -292,14 +299,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2008, 3, 20)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Viernes Santo"), @@ -328,14 +335,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2009, 4, 9)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Viernes Santo"), @@ -364,14 +371,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2010, 4, 1)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Viernes Santo"), @@ -400,14 +407,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2011, 4, 21)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Viernes Santo"), @@ -436,14 +443,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2012, 4, 5)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Viernes Santo"), @@ -472,14 +479,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2013, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Viernes Santo"), @@ -508,14 +515,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2014, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Viernes Santo"), @@ -544,14 +551,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2015, 4, 2)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Viernes Santo"), @@ -580,14 +587,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2016, 3, 24)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Viernes Santo"), @@ -616,14 +623,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2017, 4, 13)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Viernes Santo"), @@ -652,14 +659,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2018, 3, 29)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Viernes Santo"), @@ -688,14 +695,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2019, 4, 18)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Viernes Santo"), @@ -724,14 +731,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2020, 4, 9)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Viernes Santo"), @@ -760,14 +767,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2021, 4, 1)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Viernes Santo"), @@ -796,14 +803,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2022, 4, 14)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Viernes Santo"), @@ -832,14 +839,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2023, 4, 6)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Viernes Santo"), @@ -868,14 +875,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2024, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Viernes Santo"), @@ -904,14 +911,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2025, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Viernes Santo"), @@ -940,14 +947,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2026, 4, 2)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Viernes Santo"), @@ -976,14 +983,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2027, 3, 25)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Viernes Santo"), @@ -1012,14 +1019,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2028, 4, 13)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Viernes Santo"), @@ -1048,14 +1055,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2029, 3, 29)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Viernes Santo"), @@ -1084,14 +1091,14 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2030, 4, 18)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Viernes Santo"), @@ -1120,8 +1127,8 @@ pub fn build( ), ], &mut map, - Country::NI, - "Nicaragua", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/nl.rs b/src/data/nl.rs index 17ab687..414c97f 100644 --- a/src/data/nl.rs +++ b/src/data/nl.rs @@ -1,17 +1,24 @@ //! Netherlands +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Netherlands"; +const COUNTY_CODE: Country = Country::NL; + /// Generate holiday map for Netherlands. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2000, 4, 23)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Tweede paasdag"), @@ -24,14 +31,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2001, 4, 15)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Tweede paasdag"), @@ -43,14 +50,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2002, 3, 31)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Tweede paasdag"), @@ -62,14 +69,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2003, 4, 20)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Tweede paasdag"), @@ -81,14 +88,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2004, 4, 11)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Tweede paasdag"), @@ -100,14 +107,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2005, 3, 27)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Tweede paasdag"), @@ -122,14 +129,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2006, 4, 16)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Tweede paasdag"), @@ -141,14 +148,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2007, 4, 8)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Tweede paasdag"), @@ -160,14 +167,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2008, 3, 23)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Tweede paasdag"), @@ -179,14 +186,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2009, 4, 12)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Tweede paasdag"), @@ -198,14 +205,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2010, 4, 4)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Tweede paasdag"), @@ -218,14 +225,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2011, 4, 24)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Tweede paasdag"), @@ -237,14 +244,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2012, 4, 8)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Tweede paasdag"), @@ -256,14 +263,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2013, 3, 31)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Tweede paasdag"), @@ -275,14 +282,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2014, 4, 20)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Tweede paasdag"), @@ -294,14 +301,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2015, 4, 5)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Tweede paasdag"), @@ -314,14 +321,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2016, 3, 27)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Tweede paasdag"), @@ -333,14 +340,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2017, 4, 16)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Tweede paasdag"), @@ -352,14 +359,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2018, 4, 1)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Tweede paasdag"), @@ -371,14 +378,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2019, 4, 21)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Tweede paasdag"), @@ -390,14 +397,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2020, 4, 12)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Tweede paasdag"), @@ -410,14 +417,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2021, 4, 4)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Tweede paasdag"), @@ -429,14 +436,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2022, 4, 17)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Tweede paasdag"), @@ -448,14 +455,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2023, 4, 9)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2023, 4, 10)?, "Tweede paasdag"), @@ -467,14 +474,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2024, 3, 31)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Tweede paasdag"), @@ -486,14 +493,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2025, 4, 20)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Tweede paasdag"), @@ -506,14 +513,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2026, 4, 5)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Tweede paasdag"), @@ -525,14 +532,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2027, 3, 28)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Tweede paasdag"), @@ -544,14 +551,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2028, 4, 16)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Tweede paasdag"), @@ -563,14 +570,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2029, 4, 1)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Tweede paasdag"), @@ -582,14 +589,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nieuwjaarsdag"), (NaiveDate::from_ymd_res(2030, 4, 21)?, "Eerste paasdag"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Tweede paasdag"), @@ -602,8 +609,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Tweede Kerstdag"), ], &mut map, - Country::NL, - "Netherlands", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/no.rs b/src/data/no.rs index baf5d73..658d016 100644 --- a/src/data/no.rs +++ b/src/data/no.rs @@ -1,17 +1,24 @@ //! Norway +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Norway"; +const COUNTY_CODE: Country = Country::NO; + /// Generate holiday map for Norway. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2000, 4, 20)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Langfredag"), @@ -29,14 +36,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2001, 4, 12)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Langfredag"), @@ -54,14 +61,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2002, 3, 28)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Langfredag"), @@ -79,14 +86,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2003, 4, 17)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Langfredag"), @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2004, 4, 8)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Langfredag"), @@ -129,14 +136,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2005, 3, 24)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Langfredag"), @@ -154,14 +161,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2006, 4, 13)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Langfredag"), @@ -179,14 +186,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2007, 4, 5)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Langfredag"), @@ -203,14 +210,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2008, 3, 20)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Langfredag"), @@ -227,14 +234,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2009, 4, 9)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Langfredag"), @@ -252,14 +259,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2010, 4, 1)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Langfredag"), @@ -277,14 +284,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2011, 4, 21)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Langfredag"), @@ -302,14 +309,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2012, 4, 5)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Langfredag"), @@ -326,14 +333,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2013, 3, 28)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Langfredag"), @@ -351,14 +358,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2014, 4, 17)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Langfredag"), @@ -376,14 +383,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2015, 4, 2)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Langfredag"), @@ -401,14 +408,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2016, 3, 24)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Langfredag"), @@ -426,14 +433,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2017, 4, 13)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Langfredag"), @@ -451,14 +458,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2018, 3, 29)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Langfredag"), @@ -476,14 +483,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2019, 4, 18)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Langfredag"), @@ -501,14 +508,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2020, 4, 9)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Langfredag"), @@ -526,14 +533,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2021, 4, 1)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Langfredag"), @@ -551,14 +558,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2022, 4, 14)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Langfredag"), @@ -576,14 +583,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2023, 4, 6)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Langfredag"), @@ -601,14 +608,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2024, 3, 28)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Langfredag"), @@ -626,14 +633,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2025, 4, 17)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Langfredag"), @@ -651,14 +658,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2026, 4, 2)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Langfredag"), @@ -676,14 +683,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2027, 3, 25)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Langfredag"), @@ -703,14 +710,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2028, 4, 13)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Langfredag"), @@ -728,14 +735,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2029, 3, 29)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Langfredag"), @@ -753,14 +760,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Første nyttårsdag"), (NaiveDate::from_ymd_res(2030, 4, 18)?, "Skjærtorsdag"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Langfredag"), @@ -778,8 +785,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Andre juledag"), ], &mut map, - Country::NO, - "Norway", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/nz.rs b/src/data/nz.rs index 82e41d6..42ea6b6 100644 --- a/src/data/nz.rs +++ b/src/data/nz.rs @@ -1,17 +1,24 @@ //! New Zealand +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "New Zealand"; +const COUNTY_CODE: Country = Country::NZ; + /// Generate holiday map for New Zealand. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2000, 1, 3)?, @@ -35,14 +42,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2001, 1, 2)?, @@ -58,14 +65,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2002, 1, 2)?, @@ -81,14 +88,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2003, 1, 2)?, @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2004, 1, 2)?, @@ -135,14 +142,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2005, 1, 3)?, @@ -170,14 +177,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 3)?, @@ -197,14 +204,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2007, 1, 2)?, @@ -220,14 +227,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2008, 1, 2)?, @@ -243,14 +250,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2009, 1, 2)?, @@ -270,14 +277,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2010, 1, 2)?, @@ -305,14 +312,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2011, 1, 3)?, @@ -342,14 +349,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 3)?, @@ -369,14 +376,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2013, 1, 2)?, @@ -392,14 +399,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2014, 1, 2)?, @@ -415,14 +422,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2015, 1, 2)?, @@ -446,14 +453,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2016, 1, 2)?, @@ -481,14 +488,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 3)?, @@ -508,14 +515,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2018, 1, 2)?, @@ -531,14 +538,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2019, 1, 2)?, @@ -554,14 +561,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2020, 1, 2)?, @@ -585,14 +592,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2021, 1, 2)?, @@ -628,14 +635,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2022, 1, 3)?, @@ -672,14 +679,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 3)?, @@ -700,14 +707,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2024, 1, 2)?, @@ -724,14 +731,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2025, 1, 2)?, @@ -748,14 +755,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2026, 1, 2)?, @@ -780,14 +787,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2027, 1, 2)?, @@ -824,14 +831,14 @@ pub fn build( ), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 1, 3)?, @@ -860,14 +867,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2029, 1, 2)?, @@ -884,14 +891,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2030, 1, 2)?, @@ -908,8 +915,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::NZ, - "New Zealand", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/pe.rs b/src/data/pe.rs index c6b37ce..0fedbd4 100644 --- a/src/data/pe.rs +++ b/src/data/pe.rs @@ -1,17 +1,24 @@ //! Peru +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Peru"; +const COUNTY_CODE: Country = Country::PE; + /// Generate holiday map for Peru. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2000, 4, 20)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Viernes Santo"), @@ -42,14 +49,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2001, 4, 12)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Viernes Santo"), @@ -80,14 +87,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2002, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Viernes Santo"), @@ -118,14 +125,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2003, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Viernes Santo"), @@ -156,14 +163,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2004, 4, 8)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Viernes Santo"), @@ -194,14 +201,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2005, 3, 24)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Viernes Santo"), @@ -232,14 +239,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2006, 4, 13)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Viernes Santo"), @@ -270,14 +277,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2007, 4, 5)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Viernes Santo"), @@ -308,14 +315,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2008, 3, 20)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Viernes Santo"), @@ -346,14 +353,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2009, 4, 9)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Viernes Santo"), @@ -384,14 +391,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2010, 4, 1)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Viernes Santo"), @@ -422,14 +429,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2011, 4, 21)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Viernes Santo"), @@ -460,14 +467,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2012, 4, 5)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Viernes Santo"), @@ -498,14 +505,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2013, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Viernes Santo"), @@ -536,14 +543,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2014, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Viernes Santo"), @@ -574,14 +581,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2015, 4, 2)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Viernes Santo"), @@ -612,14 +619,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2016, 3, 24)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Viernes Santo"), @@ -650,14 +657,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2017, 4, 13)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Viernes Santo"), @@ -688,14 +695,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2018, 3, 29)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Viernes Santo"), @@ -726,14 +733,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2019, 4, 18)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Viernes Santo"), @@ -764,14 +771,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2020, 4, 9)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Viernes Santo"), @@ -802,14 +809,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2021, 4, 1)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Viernes Santo"), @@ -840,14 +847,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2022, 4, 14)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Viernes Santo"), @@ -880,14 +887,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2023, 4, 6)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Viernes Santo"), @@ -920,14 +927,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2024, 3, 28)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Viernes Santo"), @@ -960,14 +967,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2025, 4, 17)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Viernes Santo"), @@ -1000,14 +1007,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2026, 4, 2)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Viernes Santo"), @@ -1040,14 +1047,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2027, 3, 25)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Viernes Santo"), @@ -1080,14 +1087,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2028, 4, 13)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Viernes Santo"), @@ -1120,14 +1127,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2029, 3, 29)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Viernes Santo"), @@ -1160,14 +1167,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2030, 4, 18)?, "Jueves Santo"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Viernes Santo"), @@ -1200,8 +1207,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Navidad del Señor"), ], &mut map, - Country::PE, - "Peru", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/pk.rs b/src/data/pk.rs index e54bf3e..426d2e9 100644 --- a/src/data/pk.rs +++ b/src/data/pk.rs @@ -1,17 +1,24 @@ //! Pakistan +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Pakistan"; +const COUNTY_CODE: Country = Country::PK; + /// Generate holiday map for Pakistan. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 2, 5)?, "Kashmir Solidarity Day", @@ -65,14 +72,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 4, 15)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 2, 5)?, "Kashmir Solidarity Day", @@ -114,14 +121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 4, 4)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 2, 5)?, "Kashmir Solidarity Day", @@ -165,14 +172,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 3, 24)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 2, 5)?, "Kashmir Solidarity Day", @@ -214,14 +221,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 3, 13)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 2, 5)?, "Kashmir Solidarity Day", @@ -262,14 +269,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 3, 1)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 2, 5)?, "Kashmir Solidarity Day", @@ -290,14 +297,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 2, 18)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 2, 5)?, "Kashmir Solidarity Day", @@ -319,14 +326,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 2, 8)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 2, 5)?, "Kashmir Solidarity Day", @@ -349,14 +356,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 1, 28)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 2, 5)?, "Kashmir Solidarity Day", @@ -377,14 +384,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 1, 18)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 2, 5)?, "Kashmir Solidarity Day", @@ -409,14 +416,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 2, 5)?, "Kashmir Solidarity Day", @@ -437,14 +444,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 16)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 2, 5)?, "Kashmir Solidarity Day", @@ -467,14 +474,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 5)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 2, 5)?, "Eid Milad-un-Nabi; Kashmir Solidarity Day", @@ -494,14 +501,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 11, 23)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 2, 5)?, "Kashmir Solidarity Day", @@ -522,14 +529,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 11, 13)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 2, 5)?, "Kashmir Solidarity Day", @@ -550,14 +557,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 11, 3)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 2, 5)?, "Kashmir Solidarity Day", @@ -577,14 +584,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 10, 23)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 2, 5)?, "Kashmir Solidarity Day", @@ -604,14 +611,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 10, 11)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 2, 5)?, "Kashmir Solidarity Day", @@ -631,14 +638,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 9, 30)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 2, 5)?, "Kashmir Solidarity Day", @@ -658,14 +665,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 9, 21)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 2, 5)?, "Kashmir Solidarity Day", @@ -687,14 +694,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 9, 9)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 2, 5)?, "Kashmir Solidarity Day", @@ -714,14 +721,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 8, 29)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 2, 5)?, "Kashmir Solidarity Day", @@ -741,14 +748,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 8, 18)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 2, 5)?, "Kashmir Solidarity Day", @@ -769,14 +776,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 8, 9)?, "Ashura"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 2, 5)?, "Kashmir Solidarity Day", @@ -800,14 +807,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 7, 28)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 2, 5)?, "Kashmir Solidarity Day", @@ -840,14 +847,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 7, 16)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 2, 5)?, "Kashmir Solidarity Day", @@ -889,14 +896,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 7, 5)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 2, 5)?, "Kashmir Solidarity Day", @@ -938,14 +945,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 6, 25)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 2, 5)?, "Kashmir Solidarity Day", @@ -986,14 +993,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 6, 15)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 2, 5)?, "Kashmir Solidarity Day", @@ -1035,14 +1042,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 6, 3)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 2, 5)?, "Kashmir Solidarity Day", @@ -1084,14 +1091,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 5, 23)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 2, 5)?, "Eid-ul-Fitr (estimated); Kashmir Solidarity Day", @@ -1129,8 +1136,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 5, 12)?, "Ashura (estimated)"), ], &mut map, - Country::PK, - "Pakistan", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/pl.rs b/src/data/pl.rs index 853f7bc..f0846c4 100644 --- a/src/data/pl.rs +++ b/src/data/pl.rs @@ -1,17 +1,24 @@ //! Poland +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Poland"; +const COUNTY_CODE: Country = Country::PL; + /// Generate holiday map for Poland. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2000, 4, 23)?, @@ -50,14 +57,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2001, 4, 15)?, @@ -96,14 +103,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2002, 3, 31)?, @@ -142,14 +149,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2003, 4, 20)?, @@ -188,14 +195,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2004, 4, 11)?, @@ -234,14 +241,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2005, 3, 27)?, @@ -280,14 +287,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2006, 4, 16)?, @@ -326,14 +333,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2007, 4, 8)?, @@ -372,14 +379,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2008, 3, 23)?, @@ -418,14 +425,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2009, 4, 12)?, @@ -464,14 +471,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Nowy Rok"), ( NaiveDate::from_ymd_res(2010, 4, 4)?, @@ -510,14 +517,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Święto Trzech Króli"), ( @@ -557,14 +564,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Święto Trzech Króli"), ( @@ -604,14 +611,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2013, 1, 6)?, "Święto Trzech Króli"), ( @@ -651,14 +658,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Święto Trzech Króli"), ( @@ -698,14 +705,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Święto Trzech Króli"), ( @@ -745,14 +752,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Święto Trzech Króli"), ( @@ -792,14 +799,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Święto Trzech Króli"), ( @@ -839,14 +846,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Święto Trzech Króli"), ( @@ -890,14 +897,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2019, 1, 6)?, "Święto Trzech Króli"), ( @@ -937,14 +944,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Święto Trzech Króli"), ( @@ -984,14 +991,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Święto Trzech Króli"), ( @@ -1031,14 +1038,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Święto Trzech Króli"), ( @@ -1078,14 +1085,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Święto Trzech Króli"), ( @@ -1125,14 +1132,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Święto Trzech Króli"), ( @@ -1172,14 +1179,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Święto Trzech Króli"), ( @@ -1219,14 +1226,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Święto Trzech Króli"), ( @@ -1266,14 +1273,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Święto Trzech Króli"), ( @@ -1313,14 +1320,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Święto Trzech Króli"), ( @@ -1360,14 +1367,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Święto Trzech Króli"), ( @@ -1407,14 +1414,14 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nowy Rok"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Święto Trzech Króli"), ( @@ -1454,8 +1461,8 @@ pub fn build( ), ], &mut map, - Country::PL, - "Poland", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/pt.rs b/src/data/pt.rs index 6836937..da831be 100644 --- a/src/data/pt.rs +++ b/src/data/pt.rs @@ -1,17 +1,24 @@ //! Portugal +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Portugal"; +const COUNTY_CODE: Country = Country::PT; + /// Generate holiday map for Portugal. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2000, 4, 23)?, "Páscoa"), @@ -42,14 +49,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2001, 4, 15)?, "Páscoa"), @@ -80,14 +87,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2002, 3, 31)?, "Páscoa"), @@ -118,14 +125,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2003, 4, 20)?, "Páscoa"), @@ -156,14 +163,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2004, 4, 11)?, "Páscoa"), @@ -193,14 +200,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2005, 3, 27)?, "Páscoa"), @@ -231,14 +238,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2006, 4, 16)?, "Páscoa"), @@ -269,14 +276,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2007, 4, 8)?, "Páscoa"), @@ -307,14 +314,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2008, 3, 23)?, "Páscoa"), @@ -345,14 +352,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2009, 4, 12)?, "Páscoa"), @@ -383,14 +390,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2010, 4, 4)?, "Páscoa"), @@ -421,14 +428,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2011, 4, 24)?, "Páscoa"), @@ -459,14 +466,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2012, 4, 8)?, "Páscoa"), @@ -497,14 +504,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2013, 3, 31)?, "Páscoa"), @@ -522,14 +529,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2014, 4, 20)?, "Páscoa"), @@ -547,14 +554,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2015, 4, 5)?, "Páscoa"), @@ -572,14 +579,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2016, 3, 27)?, "Páscoa"), @@ -610,14 +617,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2017, 4, 16)?, "Páscoa"), @@ -648,14 +655,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2018, 4, 1)?, "Páscoa"), @@ -686,14 +693,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2019, 4, 21)?, "Páscoa"), @@ -724,14 +731,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2020, 4, 12)?, "Páscoa"), @@ -762,14 +769,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2021, 4, 4)?, "Páscoa"), @@ -800,14 +807,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2022, 4, 17)?, "Páscoa"), @@ -838,14 +845,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2023, 4, 9)?, "Páscoa"), @@ -876,14 +883,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2024, 3, 31)?, "Páscoa"), @@ -914,14 +921,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2025, 4, 20)?, "Páscoa"), @@ -952,14 +959,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2026, 4, 5)?, "Páscoa"), @@ -990,14 +997,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2027, 3, 28)?, "Páscoa"), @@ -1028,14 +1035,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2028, 4, 16)?, "Páscoa"), @@ -1066,14 +1073,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2029, 4, 1)?, "Páscoa"), @@ -1104,14 +1111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Ano Novo"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Sexta-feira Santa"), (NaiveDate::from_ymd_res(2030, 4, 21)?, "Páscoa"), @@ -1142,8 +1149,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Dia de Natal"), ], &mut map, - Country::PT, - "Portugal", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/py.rs b/src/data/py.rs index 3db8bda..3d18c49 100644 --- a/src/data/py.rs +++ b/src/data/py.rs @@ -1,17 +1,24 @@ //! Paraguay +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Paraguay"; +const COUNTY_CODE: Country = Country::PY; + /// Generate holiday map for Paraguay. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2000, 3, 1)?, @@ -47,14 +54,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2001, 3, 1)?, @@ -90,14 +97,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2002, 3, 1)?, @@ -133,14 +140,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2003, 3, 1)?, @@ -176,14 +183,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2004, 3, 1)?, @@ -219,14 +226,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2005, 3, 1)?, @@ -262,14 +269,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2006, 3, 1)?, @@ -305,14 +312,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2007, 3, 1)?, @@ -349,14 +356,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 1, 29)?, "Asueto adicionale"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2008, 3, 1)?, @@ -392,14 +399,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2009, 3, 1)?, @@ -436,14 +443,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 9, 10)?, "Asueto adicionale"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2010, 3, 1)?, @@ -480,14 +487,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 6, 14)?, "Asueto adicionale"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2011, 3, 1)?, @@ -526,14 +533,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 5, 16)?, "Asueto adicionale"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2012, 3, 1)?, @@ -573,14 +580,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2013, 3, 4)?, @@ -621,14 +628,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 8, 14)?, "Asueto adicionale"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2014, 3, 1)?, @@ -668,14 +675,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2015, 3, 1)?, @@ -717,14 +724,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 7, 11)?, "Asueto adicionale"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2016, 2, 29)?, @@ -764,14 +771,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2017, 3, 1)?, @@ -811,14 +818,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2018, 2, 26)?, @@ -858,14 +865,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2019, 3, 1)?, @@ -905,14 +912,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2020, 3, 1)?, @@ -952,14 +959,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2021, 3, 1)?, @@ -999,14 +1006,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2022, 2, 28)?, @@ -1046,14 +1053,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2023, 3, 1)?, @@ -1093,14 +1100,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2024, 3, 1)?, @@ -1140,14 +1147,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2025, 3, 1)?, @@ -1187,14 +1194,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2026, 3, 1)?, @@ -1234,14 +1241,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2027, 3, 1)?, @@ -1281,14 +1288,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2028, 3, 1)?, @@ -1328,14 +1335,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2029, 3, 1)?, @@ -1375,14 +1382,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2030, 3, 1)?, @@ -1422,8 +1429,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Navidad"), ], &mut map, - Country::PY, - "Paraguay", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ro.rs b/src/data/ro.rs index 51163f1..7665572 100644 --- a/src/data/ro.rs +++ b/src/data/ro.rs @@ -1,17 +1,24 @@ //! Romania +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Romania"; +const COUNTY_CODE: Country = Country::RO; + /// Generate holiday map for Romania. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2000, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2000, 4, 30)?, "Paștele"), @@ -26,14 +33,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2001, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2001, 4, 15)?, "Paștele"), @@ -49,14 +56,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2002, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2002, 5, 5)?, "Paștele"), @@ -72,14 +79,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2003, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2003, 4, 27)?, "Paștele"), @@ -95,14 +102,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2004, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2004, 4, 11)?, "Paștele"), @@ -118,14 +125,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2005, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2005, 5, 1)?, "Paștele; Ziua Muncii"), @@ -140,14 +147,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2006, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2006, 4, 23)?, "Paștele"), @@ -163,14 +170,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2007, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2007, 4, 8)?, "Paștele"), @@ -186,14 +193,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2008, 4, 27)?, "Paștele"), @@ -209,14 +216,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2009, 4, 19)?, "Paștele"), @@ -236,14 +243,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2010, 4, 4)?, "Paștele"), @@ -263,14 +270,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2011, 4, 24)?, "Paștele"), @@ -290,14 +297,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2012, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2012, 4, 15)?, "Paștele"), @@ -321,14 +328,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2013, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2013, 5, 5)?, "Paștele"), @@ -352,14 +359,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2014, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2014, 4, 20)?, "Paștele"), @@ -383,14 +390,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2015, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2015, 4, 12)?, "Paștele"), @@ -414,14 +421,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2016, 1, 2)?, "Anul Nou"), ( @@ -448,14 +455,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "Anul Nou"), ( @@ -484,14 +491,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "Anul Nou"), ( @@ -521,14 +528,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "Anul Nou"), ( @@ -558,14 +565,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "Anul Nou"), ( @@ -595,14 +602,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "Anul Nou"), ( @@ -632,14 +639,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "Anul Nou"), ( @@ -669,14 +676,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "Anul Nou"), ( @@ -706,14 +713,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Bobotează"), @@ -745,14 +752,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Bobotează"), @@ -784,14 +791,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Bobotează"), @@ -825,14 +832,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Bobotează"), @@ -864,14 +871,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Bobotează"), @@ -903,14 +910,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Bobotează"), @@ -942,14 +949,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Anul Nou"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "Anul Nou"), (NaiveDate::from_ymd_res(2030, 1, 6)?, "Bobotează"), @@ -981,8 +988,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Crăciunul"), ], &mut map, - Country::RO, - "Romania", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/rs.rs b/src/data/rs.rs index e8e8e86..37a189e 100644 --- a/src/data/rs.rs +++ b/src/data/rs.rs @@ -1,17 +1,24 @@ //! Serbia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Serbia"; +const COUNTY_CODE: Country = Country::RS; + /// Generate holiday map for Serbia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2000, 1, 2)?, "Нова година"), ( @@ -41,14 +48,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 4, 30)?, "Васкрс"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2001, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2001, 1, 7)?, "Божић"), @@ -76,14 +83,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 4, 16)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2002, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2002, 1, 7)?, "Божић"), @@ -107,14 +114,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 5, 6)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2003, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2003, 1, 7)?, "Божић"), @@ -142,14 +149,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 4, 28)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2004, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2004, 1, 7)?, "Божић"), @@ -181,14 +188,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 4, 12)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2005, 1, 2)?, "Нова година"), ( @@ -221,14 +228,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 4, 30)?, "Велика субота"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Нова година"), ( NaiveDate::from_ymd_res(2006, 1, 3)?, @@ -256,14 +263,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 4, 24)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2007, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2007, 1, 7)?, "Божић"), @@ -291,14 +298,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 4, 9)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2008, 1, 7)?, "Божић"), @@ -322,14 +329,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 4, 28)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2009, 1, 7)?, "Божић"), @@ -357,14 +364,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 4, 20)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2010, 1, 7)?, "Божић"), @@ -392,14 +399,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 4, 5)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "Нова година"), ( @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 4, 25)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Нова година"), ( NaiveDate::from_ymd_res(2012, 1, 3)?, @@ -470,14 +477,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 4, 16)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2013, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2013, 1, 7)?, "Божић"), @@ -501,14 +508,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 5, 6)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2014, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2014, 1, 7)?, "Божић"), @@ -536,14 +543,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 4, 21)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2015, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2015, 1, 7)?, "Божић"), @@ -571,14 +578,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 4, 13)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2016, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2016, 1, 7)?, "Божић"), @@ -607,14 +614,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 4, 30)?, "Велика субота"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Нова година"), ( NaiveDate::from_ymd_res(2017, 1, 3)?, @@ -642,14 +649,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 4, 17)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2018, 1, 7)?, "Божић"), @@ -677,14 +684,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 4, 9)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2019, 1, 7)?, "Божић"), @@ -708,14 +715,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 4, 29)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2020, 1, 7)?, "Божић"), @@ -743,14 +750,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 4, 20)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2021, 1, 7)?, "Божић"), @@ -779,14 +786,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 5, 3)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "Нова година"), ( @@ -818,14 +825,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 4, 25)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Нова година"), ( NaiveDate::from_ymd_res(2023, 1, 3)?, @@ -853,14 +860,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 4, 17)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2024, 1, 7)?, "Божић"), @@ -884,14 +891,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 5, 6)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2025, 1, 7)?, "Божић"), @@ -919,14 +926,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 4, 21)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2026, 1, 7)?, "Божић"), @@ -954,14 +961,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 4, 13)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2027, 1, 7)?, "Божић"), @@ -990,14 +997,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 5, 3)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "Нова година"), ( @@ -1025,14 +1032,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 4, 17)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2029, 1, 7)?, "Божић"), @@ -1060,14 +1067,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 4, 9)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Нова година"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "Нова година"), (NaiveDate::from_ymd_res(2030, 1, 7)?, "Божић"), @@ -1091,8 +1098,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 4, 29)?, "Други дан Васкрса"), ], &mut map, - Country::RS, - "Serbia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ru.rs b/src/data/ru.rs index 9f1d376..96e0aad 100644 --- a/src/data/ru.rs +++ b/src/data/ru.rs @@ -1,17 +1,24 @@ //! Russia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Russia"; +const COUNTY_CODE: Country = Country::RU; + /// Generate holiday map for Russia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Новый год"), (NaiveDate::from_ymd_res(2000, 1, 2)?, "Новый год"), (NaiveDate::from_ymd_res(2000, 1, 7)?, "Рождество Христово"), @@ -38,14 +45,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Новый год"), (NaiveDate::from_ymd_res(2001, 1, 2)?, "Новый год"), (NaiveDate::from_ymd_res(2001, 1, 7)?, "Рождество Христово"), @@ -72,14 +79,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Новый год"), (NaiveDate::from_ymd_res(2002, 1, 2)?, "Новый год"), (NaiveDate::from_ymd_res(2002, 1, 7)?, "Рождество Христово"), @@ -107,14 +114,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Новый год"), (NaiveDate::from_ymd_res(2003, 1, 2)?, "Новый год"), (NaiveDate::from_ymd_res(2003, 1, 7)?, "Рождество Христово"), @@ -142,14 +149,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Новый год"), (NaiveDate::from_ymd_res(2004, 1, 2)?, "Новый год"), (NaiveDate::from_ymd_res(2004, 1, 7)?, "Рождество Христово"), @@ -177,14 +184,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2005, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2005, 1, 3)?, "Новогодние каникулы"), @@ -211,14 +218,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2006, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2006, 1, 3)?, "Новогодние каникулы"), @@ -245,14 +252,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2007, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2007, 1, 3)?, "Новогодние каникулы"), @@ -279,14 +286,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2008, 1, 3)?, "Новогодние каникулы"), @@ -313,14 +320,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2009, 1, 3)?, "Новогодние каникулы"), @@ -347,14 +354,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2010, 1, 3)?, "Новогодние каникулы"), @@ -381,14 +388,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2011, 1, 3)?, "Новогодние каникулы"), @@ -415,14 +422,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2012, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2012, 1, 3)?, "Новогодние каникулы"), @@ -449,14 +456,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2013, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2013, 1, 3)?, "Новогодние каникулы"), @@ -485,14 +492,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2014, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2014, 1, 3)?, "Новогодние каникулы"), @@ -521,14 +528,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2015, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2015, 1, 3)?, "Новогодние каникулы"), @@ -557,14 +564,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2016, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2016, 1, 3)?, "Новогодние каникулы"), @@ -593,14 +600,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2017, 1, 3)?, "Новогодние каникулы"), @@ -629,14 +636,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2018, 1, 3)?, "Новогодние каникулы"), @@ -665,14 +672,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2019, 1, 3)?, "Новогодние каникулы"), @@ -701,14 +708,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2020, 1, 3)?, "Новогодние каникулы"), @@ -737,14 +744,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2021, 1, 3)?, "Новогодние каникулы"), @@ -773,14 +780,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2022, 1, 3)?, "Новогодние каникулы"), @@ -809,14 +816,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2023, 1, 3)?, "Новогодние каникулы"), @@ -853,14 +860,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2024, 1, 3)?, "Новогодние каникулы"), @@ -909,14 +916,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2025, 1, 3)?, "Новогодние каникулы"), @@ -945,14 +952,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2026, 1, 3)?, "Новогодние каникулы"), @@ -981,14 +988,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2027, 1, 3)?, "Новогодние каникулы"), @@ -1017,14 +1024,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2028, 1, 3)?, "Новогодние каникулы"), @@ -1053,14 +1060,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2029, 1, 3)?, "Новогодние каникулы"), @@ -1089,14 +1096,14 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "Новогодние каникулы"), (NaiveDate::from_ymd_res(2030, 1, 3)?, "Новогодние каникулы"), @@ -1125,8 +1132,8 @@ pub fn build( ), ], &mut map, - Country::RU, - "Russia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/sa.rs b/src/data/sa.rs index 7963fad..d78c5fb 100644 --- a/src/data/sa.rs +++ b/src/data/sa.rs @@ -1,17 +1,24 @@ //! Saudi Arabia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Saudi Arabia"; +const COUNTY_CODE: Country = Country::SA; + /// Generate holiday map for Saudi Arabia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 8)?, "(تقدير) عطلة عيد الفطر", @@ -71,14 +78,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 12, 16)?, "(تقدير) عطلة عيد الفطر", @@ -114,14 +121,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 12, 5)?, "(تقدير) عطلة عيد الفطر", @@ -169,14 +176,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 11, 25)?, "(تقدير) عطلة عيد الفطر", @@ -220,14 +227,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 11, 14)?, "(تقدير) عطلة عيد الفطر", @@ -259,14 +266,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 11, 3)?, "(تقدير) عطلة عيد الفطر", @@ -319,14 +326,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 10, 23)?, "(تقدير) عطلة عيد الفطر", @@ -372,14 +379,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 10, 13)?, "(تقدير) عطلة عيد الفطر", @@ -428,14 +435,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 10, 1)?, "(تقدير) عطلة عيد الفطر", @@ -476,14 +483,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 9, 20)?, "(تقدير) عطلة عيد الفطر", @@ -523,14 +530,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 9, 10)?, "(تقدير) عطلة عيد الفطر", @@ -575,14 +582,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 8, 30)?, "(تقدير) عطلة عيد الفطر", @@ -627,14 +634,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 8, 19)?, "(تقدير) عطلة عيد الفطر", @@ -675,14 +682,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 8, 8)?, "(تقدير) عطلة عيد الفطر", @@ -723,14 +730,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 7, 28)?, "(تقدير) عطلة عيد الفطر", @@ -771,14 +778,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 7, 17)?, "(تقدير) عطلة عيد الفطر", @@ -822,14 +829,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 7, 6)?, "(تقدير) عطلة عيد الفطر", @@ -878,14 +885,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 6, 25)?, "(تقدير) عطلة عيد الفطر", @@ -930,14 +937,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 6, 15)?, "(تقدير) عطلة عيد الفطر", @@ -978,14 +985,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 6, 4)?, "(تقدير) عطلة عيد الفطر", @@ -1026,14 +1033,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 5, 24)?, "(تقدير) عطلة عيد الفطر", @@ -1074,14 +1081,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 5, 13)?, "(تقدير) عطلة عيد الفطر", @@ -1122,14 +1129,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 9, 23)?, "اليوم الوطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 5, 2)?, "(تقدير) عطلة عيد الفطر", @@ -1176,14 +1183,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 11, 23)?, "يوم وطني"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 4, 21)?, "(تقدير) عطلة عيد الفطر", @@ -1233,14 +1240,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 2, 22)?, "يوم التأسيسي"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 4, 10)?, "(تقدير) عطلة عيد الفطر", @@ -1286,14 +1293,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 2, 22)?, "يوم التأسيسي"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 3, 30)?, "(تقدير) عطلة عيد الفطر", @@ -1339,14 +1346,14 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 3, 20)?, "(تقدير) عطلة عيد الفطر", @@ -1392,14 +1399,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 2, 22)?, "يوم التأسيسي"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 3, 9)?, "(تقدير) عطلة عيد الفطر", @@ -1441,14 +1448,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 2, 22)?, "يوم التأسيسي"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 2, 26)?, "(تقدير) عطلة عيد الفطر", @@ -1498,14 +1505,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 2, 22)?, "يوم التأسيسي"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 2, 14)?, "(تقدير) عطلة عيد الفطر", @@ -1547,14 +1554,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 2, 22)?, "يوم التأسيسي"), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 2, 4)?, "(تقدير) عطلة عيد الفطر", @@ -1600,8 +1607,8 @@ pub fn build( ), ], &mut map, - Country::SA, - "Saudi Arabia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/se.rs b/src/data/se.rs index 3cc02e4..9cd5e95 100644 --- a/src/data/se.rs +++ b/src/data/se.rs @@ -1,17 +1,24 @@ //! Sweden +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Sweden"; +const COUNTY_CODE: Country = Country::SE; + /// Generate holiday map for Sweden. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2000, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Långfredagen"), @@ -82,14 +89,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 17)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2001, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Långfredagen"), @@ -161,14 +168,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 30)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Nyårsdagen"), ( NaiveDate::from_ymd_res(2002, 1, 6)?, @@ -242,14 +249,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 29)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2003, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Långfredagen"), @@ -321,14 +328,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 28)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2004, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Långfredagen"), @@ -402,14 +409,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 19)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2005, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Långfredagen"), @@ -479,14 +486,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 18)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Nyårsdagen; Söndag"), (NaiveDate::from_ymd_res(2006, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Långfredagen"), @@ -556,14 +563,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 17)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2007, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Långfredagen"), @@ -635,14 +642,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 30)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Nyårsdagen"), ( NaiveDate::from_ymd_res(2008, 1, 6)?, @@ -715,14 +722,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 28)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2009, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Långfredagen"), @@ -794,14 +801,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 27)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2010, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Långfredagen"), @@ -877,14 +884,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 19)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2011, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Långfredagen"), @@ -954,14 +961,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 18)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Nyårsdagen; Söndag"), (NaiveDate::from_ymd_res(2012, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Långfredagen"), @@ -1033,14 +1040,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 30)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Nyårsdagen"), ( NaiveDate::from_ymd_res(2013, 1, 6)?, @@ -1114,14 +1121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 29)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2014, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Långfredagen"), @@ -1193,14 +1200,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 28)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2015, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Långfredagen"), @@ -1272,14 +1279,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 27)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2016, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Långfredagen"), @@ -1349,14 +1356,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 18)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Nyårsdagen; Söndag"), (NaiveDate::from_ymd_res(2017, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Långfredagen"), @@ -1426,14 +1433,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 17)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2018, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Långfredagen"), @@ -1505,14 +1512,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 30)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Nyårsdagen"), ( NaiveDate::from_ymd_res(2019, 1, 6)?, @@ -1586,14 +1593,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 29)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2020, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Långfredagen"), @@ -1665,14 +1672,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 27)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2021, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Långfredagen"), @@ -1748,14 +1755,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 19)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2022, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Långfredagen"), @@ -1825,14 +1832,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 18)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Nyårsdagen; Söndag"), (NaiveDate::from_ymd_res(2023, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2023, 4, 7)?, "Långfredagen"), @@ -1902,14 +1909,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 17)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2024, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Långfredagen"), @@ -1981,14 +1988,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 29)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2025, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Långfredagen"), @@ -2060,14 +2067,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 28)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2026, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Långfredagen"), @@ -2139,14 +2146,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 27)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2027, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Långfredagen"), @@ -2222,14 +2229,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 19)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2028, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Långfredagen"), @@ -2300,14 +2307,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 17)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Nyårsdagen"), (NaiveDate::from_ymd_res(2029, 1, 6)?, "Trettondedag jul"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Långfredagen"), @@ -2379,14 +2386,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 30)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Nyårsdagen"), ( NaiveDate::from_ymd_res(2030, 1, 6)?, @@ -2460,8 +2467,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 29)?, "Söndag"), ], &mut map, - Country::SE, - "Sweden", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/sg.rs b/src/data/sg.rs index ab5ffd8..b4f1e2b 100644 --- a/src/data/sg.rs +++ b/src/data/sg.rs @@ -1,17 +1,24 @@ //! Singapore +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Singapore"; +const COUNTY_CODE: Country = Country::SG; + /// Generate holiday map for Singapore. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2000, 2, 5)?, @@ -48,14 +55,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 1, 24)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2001, 1, 25)?, "Chinese New Year"), @@ -74,14 +81,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 11, 3)?, "Polling Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 2, 12)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2002, 2, 13)?, "Chinese New Year"), @@ -103,14 +110,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 2, 1)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2003, 2, 2)?, "Chinese New Year"), @@ -128,14 +135,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 1, 22)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2004, 1, 23)?, "Chinese New Year"), @@ -157,14 +164,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 2, 9)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2005, 2, 10)?, "Chinese New Year"), @@ -190,14 +197,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2006, 1, 30)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2006, 1, 31)?, "Chinese New Year"), @@ -217,14 +224,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 5, 6)?, "Polling Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 2, 19)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2007, 2, 20)?, "Chinese New Year"), @@ -242,14 +249,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 2, 7)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2008, 2, 8)?, "Chinese New Year"), @@ -263,14 +270,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Christmas Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 1, 26)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2009, 1, 27)?, "Chinese New Year"), @@ -296,14 +303,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 2, 14)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2010, 2, 15)?, "Chinese New Year"), @@ -321,14 +328,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 2, 3)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2011, 2, 4)?, "Chinese New Year"), @@ -355,14 +362,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 5, 7)?, "Polling Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2012, 1, 23)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2012, 1, 24)?, "Chinese New Year"), @@ -384,14 +391,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 2, 10)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2013, 2, 11)?, "Chinese New Year"), @@ -409,14 +416,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 1, 31)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2014, 2, 1)?, "Chinese New Year"), @@ -434,14 +441,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 2, 19)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2015, 2, 20)?, "Chinese New Year"), @@ -461,14 +468,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 9, 11)?, "Polling Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2016, 2, 9)?, "Chinese New Year"), @@ -490,14 +497,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2017, 1, 28)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2017, 1, 29)?, "Chinese New Year"), @@ -523,14 +530,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 2, 16)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2018, 2, 17)?, "Chinese New Year"), @@ -544,14 +551,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Christmas Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 2, 5)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2019, 2, 6)?, "Chinese New Year"), @@ -577,14 +584,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 1, 25)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2020, 1, 26)?, "Chinese New Year"), @@ -611,14 +618,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 7, 10)?, "Polling Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 2, 12)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2021, 2, 13)?, "Chinese New Year"), @@ -632,14 +639,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Christmas Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 2, 1)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2022, 2, 2)?, "Chinese New Year"), @@ -669,14 +676,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2023, 1, 22)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2023, 1, 23)?, "Chinese New Year"), @@ -703,14 +710,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 9, 1)?, "Polling Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 2, 10)?, "Chinese New Year"), (NaiveDate::from_ymd_res(2024, 2, 11)?, "Chinese New Year"), @@ -728,14 +735,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2025, 1, 29)?, @@ -772,14 +779,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2026, 2, 17)?, @@ -816,14 +823,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2027, 2, 6)?, @@ -860,14 +867,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 1, 26)?, @@ -896,14 +903,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Christmas Day"), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2029, 2, 13)?, @@ -936,14 +943,14 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2030, 2, 3)?, @@ -972,8 +979,8 @@ pub fn build( ), ], &mut map, - Country::SG, - "Singapore", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/si.rs b/src/data/si.rs index 8c5fea2..64c95e0 100644 --- a/src/data/si.rs +++ b/src/data/si.rs @@ -1,17 +1,24 @@ //! Slovenia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Slovenia"; +const COUNTY_CODE: Country = Country::SI; + /// Generate holiday map for Slovenia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2000, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2000, 2, 8)?, "Prešernov dan"), @@ -42,14 +49,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2001, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2001, 2, 8)?, "Prešernov dan"), @@ -80,14 +87,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2002, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2002, 2, 8)?, "Prešernov dan"), @@ -118,14 +125,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2003, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2003, 2, 8)?, "Prešernov dan"), @@ -156,14 +163,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2004, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2004, 2, 8)?, "Prešernov dan"), @@ -194,14 +201,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2005, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2005, 2, 8)?, "Prešernov dan"), @@ -232,14 +239,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2006, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2006, 2, 8)?, "Prešernov dan"), @@ -270,14 +277,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2007, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2007, 2, 8)?, "Prešernov dan"), @@ -308,14 +315,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2008, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2008, 2, 8)?, "Prešernov dan"), @@ -346,14 +353,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2009, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2009, 2, 8)?, "Prešernov dan"), @@ -384,14 +391,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2010, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2010, 2, 8)?, "Prešernov dan"), @@ -422,14 +429,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2011, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2011, 2, 8)?, "Prešernov dan"), @@ -460,14 +467,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2012, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2012, 2, 8)?, "Prešernov dan"), @@ -498,14 +505,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2013, 2, 8)?, "Prešernov dan"), ( @@ -535,14 +542,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2014, 2, 8)?, "Prešernov dan"), ( @@ -572,14 +579,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2015, 2, 8)?, "Prešernov dan"), ( @@ -609,14 +616,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "Prešernov dan"), ( @@ -646,14 +653,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2017, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2017, 2, 8)?, "Prešernov dan"), @@ -684,14 +691,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2018, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2018, 2, 8)?, "Prešernov dan"), @@ -722,14 +729,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2019, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2019, 2, 8)?, "Prešernov dan"), @@ -760,14 +767,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2020, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2020, 2, 8)?, "Prešernov dan"), @@ -798,14 +805,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2021, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2021, 2, 8)?, "Prešernov dan"), @@ -836,14 +843,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2022, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2022, 2, 8)?, "Prešernov dan"), @@ -874,14 +881,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2023, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2023, 2, 8)?, "Prešernov dan"), @@ -913,14 +920,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 8, 14)?, "dan solidarnosti"), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2024, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2024, 2, 8)?, "Prešernov dan"), @@ -951,14 +958,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2025, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2025, 2, 8)?, "Prešernov dan"), @@ -989,14 +996,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2026, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2026, 2, 8)?, "Prešernov dan"), @@ -1027,14 +1034,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2027, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2027, 2, 8)?, "Prešernov dan"), @@ -1065,14 +1072,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2028, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2028, 2, 8)?, "Prešernov dan"), @@ -1103,14 +1110,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2029, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2029, 2, 8)?, "Prešernov dan"), @@ -1141,14 +1148,14 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "novo leto"), (NaiveDate::from_ymd_res(2030, 1, 2)?, "novo leto"), (NaiveDate::from_ymd_res(2030, 2, 8)?, "Prešernov dan"), @@ -1179,8 +1186,8 @@ pub fn build( ), ], &mut map, - Country::SI, - "Slovenia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/sk.rs b/src/data/sk.rs index 42abba8..2fac5bf 100644 --- a/src/data/sk.rs +++ b/src/data/sk.rs @@ -1,17 +1,24 @@ //! Slovakia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Slovakia"; +const COUNTY_CODE: Country = Country::SK; + /// Generate holiday map for Slovakia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -58,14 +65,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -116,14 +123,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -174,14 +181,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -232,14 +239,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -290,14 +297,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -348,14 +355,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -406,14 +413,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -464,14 +471,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -522,14 +529,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -580,14 +587,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -638,14 +645,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -696,14 +703,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -754,14 +761,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -812,14 +819,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -870,14 +877,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -928,14 +935,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -986,14 +993,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1044,14 +1051,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1106,14 +1113,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1164,14 +1171,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1222,14 +1229,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1280,14 +1287,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1338,14 +1345,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1396,14 +1403,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1454,14 +1461,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1512,14 +1519,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1570,14 +1577,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1628,14 +1635,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1686,14 +1693,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1744,14 +1751,14 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 1)?, "Deň vzniku Slovenskej republiky", @@ -1802,8 +1809,8 @@ pub fn build( ), ], &mut map, - Country::SK, - "Slovakia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/sz.rs b/src/data/sz.rs index 7397e7d..edf5e89 100644 --- a/src/data/sz.rs +++ b/src/data/sz.rs @@ -1,17 +1,24 @@ //! Swaziland +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Swaziland"; +const COUNTY_CODE: Country = Country::SZ; + /// Generate holiday map for Swaziland. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Easter Monday"), @@ -29,14 +36,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 1, 3)?, "Y2K changeover"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Easter Monday"), @@ -53,14 +60,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Easter Monday"), @@ -77,14 +84,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Easter Monday"), @@ -101,14 +108,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Easter Monday"), @@ -125,14 +132,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Easter Monday"), @@ -149,14 +156,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2006, 4, 17)?, "Easter Monday"), @@ -173,14 +180,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Easter Monday"), @@ -197,14 +204,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 3, 24)?, "Easter Monday"), @@ -223,14 +230,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Easter Monday"), @@ -247,14 +254,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Easter Monday"), @@ -271,14 +278,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), ( @@ -297,14 +304,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2012, 4, 9)?, "Easter Monday"), @@ -321,14 +328,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Easter Monday"), @@ -345,14 +352,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Easter Monday"), @@ -369,14 +376,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Easter Monday"), @@ -393,14 +400,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Easter Monday"), @@ -417,14 +424,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2017, 4, 17)?, "Easter Monday"), @@ -441,14 +448,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Easter Monday"), @@ -465,14 +472,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2019, 4, 19)?, @@ -491,14 +498,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Easter Monday"), @@ -515,14 +522,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Easter Monday"), @@ -547,14 +554,14 @@ pub fn build( ), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Easter Monday"), @@ -579,14 +586,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -607,14 +614,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Easter Monday"), @@ -631,14 +638,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Easter Monday"), @@ -655,14 +662,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Easter Monday"), @@ -687,14 +694,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Easter Monday"), @@ -719,14 +726,14 @@ pub fn build( ), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Easter Monday"), @@ -743,14 +750,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Easter Monday"), @@ -771,14 +778,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2030, 4, 19)?, @@ -797,8 +804,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::SZ, - "Swaziland", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/tn.rs b/src/data/tn.rs index 97f4a3f..b6d4b4b 100644 --- a/src/data/tn.rs +++ b/src/data/tn.rs @@ -1,17 +1,24 @@ //! Tunisia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Tunisia"; +const COUNTY_CODE: Country = Country::TN; + /// Generate holiday map for Tunisia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2000, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2000, 3, 20)?, "عيد الإستقلال"), @@ -58,14 +65,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2001, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2001, 3, 20)?, "عيد الإستقلال"), @@ -103,14 +110,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2002, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2002, 3, 20)?, "عيد الإستقلال"), @@ -148,14 +155,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2003, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2003, 3, 20)?, "عيد الإستقلال"), @@ -193,14 +200,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2004, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2004, 3, 20)?, "عيد الإستقلال"), @@ -237,14 +244,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2005, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2005, 3, 20)?, "عيد الإستقلال"), @@ -282,14 +289,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2006, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2006, 3, 20)?, "عيد الإستقلال"), @@ -329,14 +336,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "(تقدير) عطلة عيد الأضحى; رأس السنة الميلادية", @@ -380,14 +387,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2008, 1, 14)?, "عيد الثورة والشباب"), ( @@ -428,14 +435,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2009, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2009, 3, 20)?, "عيد الإستقلال"), @@ -473,14 +480,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2010, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2010, 3, 20)?, "عيد الإستقلال"), @@ -518,14 +525,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2011, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2011, 3, 20)?, "عيد الإستقلال"), @@ -563,14 +570,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2012, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2012, 3, 20)?, "عيد الإستقلال"), @@ -608,14 +615,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2013, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2013, 3, 20)?, "عيد الإستقلال"), @@ -655,14 +662,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2014, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2014, 3, 20)?, "عيد الإستقلال"), @@ -700,14 +707,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2015, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2015, 3, 20)?, "عيد الإستقلال"), @@ -749,14 +756,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2016, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2016, 3, 20)?, "عيد الإستقلال"), @@ -794,14 +801,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2017, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2017, 3, 20)?, "عيد الإستقلال"), @@ -839,14 +846,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2018, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2018, 3, 20)?, "عيد الإستقلال"), @@ -884,14 +891,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2019, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2019, 3, 20)?, "عيد الإستقلال"), @@ -928,14 +935,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2020, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2020, 3, 20)?, "عيد الإستقلال"), @@ -973,14 +980,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2021, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2021, 3, 20)?, "عيد الإستقلال"), @@ -1018,14 +1025,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2022, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2022, 3, 20)?, "عيد الإستقلال"), @@ -1063,14 +1070,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2023, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2023, 3, 20)?, "عيد الإستقلال"), @@ -1108,14 +1115,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2024, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2024, 3, 20)?, "عيد الإستقلال"), @@ -1153,14 +1160,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2025, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2025, 3, 20)?, "عيد الإستقلال"), @@ -1198,14 +1205,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2026, 1, 14)?, "عيد الثورة والشباب"), ( @@ -1245,14 +1252,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2027, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2027, 3, 20)?, "عيد الإستقلال"), @@ -1290,14 +1297,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2028, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2028, 3, 20)?, "عيد الإستقلال"), @@ -1335,14 +1342,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2029, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2029, 3, 20)?, "عيد الإستقلال"), @@ -1380,14 +1387,14 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "رأس السنة الميلادية"), (NaiveDate::from_ymd_res(2030, 1, 14)?, "عيد الثورة والشباب"), (NaiveDate::from_ymd_res(2030, 3, 20)?, "عيد الإستقلال"), @@ -1425,8 +1432,8 @@ pub fn build( ), ], &mut map, - Country::TN, - "Tunisia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/tr.rs b/src/data/tr.rs index e9fab0b..b42f99f 100644 --- a/src/data/tr.rs +++ b/src/data/tr.rs @@ -1,17 +1,24 @@ //! Turkey +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Turkey"; +const COUNTY_CODE: Country = Country::TR; + /// Generate holiday map for Turkey. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2000, 4, 23)?, @@ -35,14 +42,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 3, 19)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2001, 4, 23)?, @@ -63,14 +70,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 3, 8)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2002, 4, 23)?, @@ -91,14 +98,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 2, 25)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2003, 4, 23)?, @@ -119,14 +126,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 2, 14)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2004, 4, 23)?, @@ -147,14 +154,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 2, 4)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2005, 4, 23)?, @@ -175,14 +182,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 1, 23)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2006, 4, 23)?, @@ -204,14 +211,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 1, 13)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "Kurban Bayramı; Yılbaşı", @@ -237,14 +244,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 23)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2008, 4, 23)?, @@ -265,14 +272,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 11)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2009, 4, 23)?, @@ -297,14 +304,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 11, 30)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2010, 4, 23)?, @@ -329,14 +336,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 11, 19)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2011, 4, 23)?, @@ -363,14 +370,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 11, 9)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2012, 4, 23)?, @@ -395,14 +402,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 10, 28)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2013, 4, 23)?, @@ -427,14 +434,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 10, 18)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2014, 4, 23)?, @@ -459,14 +466,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 10, 7)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2015, 4, 23)?, @@ -491,14 +498,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 9, 27)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2016, 4, 23)?, @@ -523,14 +530,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 9, 15)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2017, 4, 23)?, @@ -559,14 +566,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 9, 4)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2018, 4, 23)?, @@ -595,14 +602,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 8, 24)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2019, 4, 23)?, @@ -631,14 +638,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 8, 14)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2020, 4, 23)?, @@ -667,14 +674,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 8, 3)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2021, 4, 23)?, @@ -703,14 +710,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 7, 23)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2022, 4, 23)?, @@ -739,14 +746,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 7, 12)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2023, 4, 23)?, @@ -774,14 +781,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 7, 1)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2024, 4, 23)?, @@ -810,14 +817,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 6, 19)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2025, 4, 23)?, @@ -846,14 +853,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 6, 9)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2026, 4, 23)?, @@ -882,14 +889,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 5, 30)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2027, 4, 23)?, @@ -917,14 +924,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 5, 18)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2028, 4, 23)?, @@ -953,14 +960,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 5, 8)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2029, 4, 23)?, @@ -989,14 +996,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 4, 27)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Yılbaşı"), ( NaiveDate::from_ymd_res(2030, 4, 23)?, @@ -1025,8 +1032,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 4, 16)?, "Kurban Bayramı"), ], &mut map, - Country::TR, - "Turkey", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/tw.rs b/src/data/tw.rs index 230b82e..7485a4f 100644 --- a/src/data/tw.rs +++ b/src/data/tw.rs @@ -1,17 +1,24 @@ //! Taiwan +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Taiwan"; +const COUNTY_CODE: Country = Country::TW; + /// Generate holiday map for Taiwan. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2000, 2, 4)?, "農曆除夕"), (NaiveDate::from_ymd_res(2000, 2, 5)?, "春節"), @@ -24,14 +31,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2001, 1, 23)?, "農曆除夕"), (NaiveDate::from_ymd_res(2001, 1, 24)?, "春節"), @@ -44,14 +51,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2002, 2, 11)?, "農曆除夕"), (NaiveDate::from_ymd_res(2002, 2, 12)?, "春節"), @@ -64,14 +71,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2003, 1, 31)?, "農曆除夕"), (NaiveDate::from_ymd_res(2003, 2, 1)?, "春節"), @@ -84,14 +91,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2004, 1, 21)?, "農曆除夕"), (NaiveDate::from_ymd_res(2004, 1, 22)?, "春節"), @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2005, 2, 8)?, "農曆除夕"), (NaiveDate::from_ymd_res(2005, 2, 9)?, "春節"), @@ -124,14 +131,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2006, 1, 28)?, "農曆除夕"), (NaiveDate::from_ymd_res(2006, 1, 29)?, "春節"), @@ -144,14 +151,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2007, 2, 17)?, "農曆除夕"), (NaiveDate::from_ymd_res(2007, 2, 18)?, "春節"), @@ -164,14 +171,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2008, 2, 6)?, "農曆除夕"), (NaiveDate::from_ymd_res(2008, 2, 7)?, "春節"), @@ -184,14 +191,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2009, 1, 25)?, "農曆除夕"), (NaiveDate::from_ymd_res(2009, 1, 26)?, "春節"), @@ -204,14 +211,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 10, 10)?, "中華民國國慶日"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2010, 2, 13)?, "農曆除夕"), (NaiveDate::from_ymd_res(2010, 2, 14)?, "春節"), @@ -230,14 +237,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2011, 2, 2)?, "農曆除夕"), (NaiveDate::from_ymd_res(2011, 2, 3)?, "春節"), @@ -252,14 +259,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 2, 7)?, "春節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2012, 1, 22)?, "農曆除夕"), (NaiveDate::from_ymd_res(2012, 1, 23)?, "春節"), @@ -285,14 +292,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2013, 2, 9)?, "農曆除夕"), (NaiveDate::from_ymd_res(2013, 2, 10)?, "春節"), @@ -316,14 +323,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 4, 5)?, "兒童節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2014, 1, 30)?, "農曆除夕"), (NaiveDate::from_ymd_res(2014, 1, 31)?, "春節"), @@ -339,14 +346,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 2, 4)?, "春節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2015, 2, 18)?, "農曆除夕"), (NaiveDate::from_ymd_res(2015, 2, 19)?, "春節"), @@ -374,14 +381,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2016, 2, 7)?, "農曆除夕"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "春節"), @@ -409,14 +416,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 4, 5)?, "兒童節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2017, 1, 27)?, "農曆除夕"), (NaiveDate::from_ymd_res(2017, 1, 28)?, "春節"), @@ -448,14 +455,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 4, 3)?, "兒童節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2018, 2, 15)?, "農曆除夕"), (NaiveDate::from_ymd_res(2018, 2, 16)?, "春節"), @@ -479,14 +486,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2019, 2, 4)?, "農曆除夕"), (NaiveDate::from_ymd_res(2019, 2, 5)?, "春節"), @@ -512,14 +519,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2020, 1, 24)?, "農曆除夕"), (NaiveDate::from_ymd_res(2020, 1, 25)?, "春節"), @@ -552,14 +559,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "中華民國開國紀念日"), ( NaiveDate::from_ymd_res(2021, 12, 31)?, @@ -594,14 +601,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 4, 2)?, "兒童節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2022, 1, 31)?, "農曆除夕"), (NaiveDate::from_ymd_res(2022, 2, 1)?, "春節"), @@ -620,14 +627,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2023, 1, 21)?, "農曆除夕"), (NaiveDate::from_ymd_res(2023, 1, 22)?, "春節"), @@ -671,14 +678,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2024, 2, 9)?, "農曆除夕"), (NaiveDate::from_ymd_res(2024, 2, 10)?, "春節"), @@ -698,14 +705,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 4, 5)?, "兒童節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2025, 1, 28)?, "農曆除夕"), (NaiveDate::from_ymd_res(2025, 1, 29)?, "春節"), @@ -719,14 +726,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 5, 30)?, "端午節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2026, 2, 16)?, "農曆除夕"), (NaiveDate::from_ymd_res(2026, 2, 17)?, "春節"), @@ -747,14 +754,14 @@ pub fn build( ), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "中華民國開國紀念日"), ( NaiveDate::from_ymd_res(2027, 12, 31)?, @@ -780,14 +787,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 2, 10)?, "春節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2028, 1, 25)?, "農曆除夕"), (NaiveDate::from_ymd_res(2028, 1, 26)?, "春節"), @@ -801,14 +808,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 5, 29)?, "端午節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2029, 2, 12)?, "農曆除夕"), (NaiveDate::from_ymd_res(2029, 2, 13)?, "春節"), @@ -823,14 +830,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 9, 21)?, "中秋節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "中華民國開國紀念日"), (NaiveDate::from_ymd_res(2030, 2, 2)?, "農曆除夕"), (NaiveDate::from_ymd_res(2030, 2, 3)?, "春節"), @@ -846,8 +853,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 2, 7)?, "春節(慶祝)"), ], &mut map, - Country::TW, - "Taiwan", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ua.rs b/src/data/ua.rs index d13ebc5..691aacf 100644 --- a/src/data/ua.rs +++ b/src/data/ua.rs @@ -1,17 +1,24 @@ //! Ukraine +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Ukraine"; +const COUNTY_CODE: Country = Country::UA; + /// Generate holiday map for Ukraine. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2000, 1, 7)?, @@ -56,14 +63,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2001, 1, 7)?, @@ -127,14 +134,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2002, 1, 7)?, @@ -186,14 +193,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2003, 1, 7)?, @@ -245,14 +252,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2004, 1, 7)?, @@ -316,14 +323,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2005, 1, 7)?, @@ -371,14 +378,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2006, 1, 7)?, @@ -443,14 +450,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2007, 1, 7)?, @@ -522,14 +529,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2008, 1, 7)?, @@ -597,14 +604,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2009, 1, 7)?, @@ -668,14 +675,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2010, 1, 7)?, @@ -743,14 +750,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2011, 1, 7)?, @@ -799,14 +806,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2012, 1, 7)?, @@ -863,14 +870,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2013, 1, 7)?, @@ -918,14 +925,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2014, 1, 7)?, @@ -985,14 +992,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2015, 1, 7)?, @@ -1060,14 +1067,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2016, 1, 7)?, @@ -1121,14 +1128,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2017, 1, 7)?, @@ -1192,14 +1199,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2018, 1, 7)?, @@ -1267,14 +1274,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2019, 1, 7)?, @@ -1330,14 +1337,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2020, 1, 7)?, @@ -1393,14 +1400,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2021, 1, 7)?, @@ -1464,14 +1471,14 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Новий рік"), ( NaiveDate::from_ymd_res(2022, 1, 7)?, @@ -1488,8 +1495,8 @@ pub fn build( ), ], &mut map, - Country::UA, - "Ukraine", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/us.rs b/src/data/us.rs index 69be77f..fb06f93 100644 --- a/src/data/us.rs +++ b/src/data/us.rs @@ -1,17 +1,24 @@ //! United States +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "United States"; +const COUNTY_CODE: Country = Country::US; + /// Generate holiday map for United States. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 5, 29)?, "Memorial Day"), (NaiveDate::from_ymd_res(2000, 7, 4)?, "Independence Day"), @@ -34,14 +41,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 10, 9)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 5, 28)?, "Memorial Day"), (NaiveDate::from_ymd_res(2001, 7, 4)?, "Independence Day"), @@ -64,14 +71,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 10, 8)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 5, 27)?, "Memorial Day"), (NaiveDate::from_ymd_res(2002, 7, 4)?, "Independence Day"), @@ -90,14 +97,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 10, 14)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 5, 26)?, "Memorial Day"), (NaiveDate::from_ymd_res(2003, 7, 4)?, "Independence Day"), @@ -116,14 +123,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 10, 13)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2004, 12, 31)?, @@ -154,14 +161,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 10, 11)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 5, 30)?, "Memorial Day"), (NaiveDate::from_ymd_res(2005, 7, 4)?, "Independence Day"), @@ -184,14 +191,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 10, 10)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -218,14 +225,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 10, 9)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 5, 28)?, "Memorial Day"), (NaiveDate::from_ymd_res(2007, 7, 4)?, "Independence Day"), @@ -248,14 +255,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 10, 8)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 5, 26)?, "Memorial Day"), (NaiveDate::from_ymd_res(2008, 7, 4)?, "Independence Day"), @@ -274,14 +281,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 10, 13)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 5, 25)?, "Memorial Day"), (NaiveDate::from_ymd_res(2009, 7, 4)?, "Independence Day"), @@ -304,14 +311,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 10, 12)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2010, 12, 31)?, @@ -342,14 +349,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 10, 11)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 5, 30)?, "Memorial Day"), (NaiveDate::from_ymd_res(2011, 7, 4)?, "Independence Day"), @@ -372,14 +379,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 10, 10)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -406,14 +413,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 10, 8)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 5, 27)?, "Memorial Day"), (NaiveDate::from_ymd_res(2013, 7, 4)?, "Independence Day"), @@ -432,14 +439,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 10, 14)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 5, 26)?, "Memorial Day"), (NaiveDate::from_ymd_res(2014, 7, 4)?, "Independence Day"), @@ -458,14 +465,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 10, 13)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 5, 25)?, "Memorial Day"), (NaiveDate::from_ymd_res(2015, 7, 4)?, "Independence Day"), @@ -488,14 +495,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 10, 12)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 5, 30)?, "Memorial Day"), (NaiveDate::from_ymd_res(2016, 7, 4)?, "Independence Day"), @@ -518,14 +525,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 10, 10)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -552,14 +559,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 10, 9)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 5, 28)?, "Memorial Day"), (NaiveDate::from_ymd_res(2018, 7, 4)?, "Independence Day"), @@ -582,14 +589,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 10, 8)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 5, 27)?, "Memorial Day"), (NaiveDate::from_ymd_res(2019, 7, 4)?, "Independence Day"), @@ -608,14 +615,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 10, 14)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 5, 25)?, "Memorial Day"), (NaiveDate::from_ymd_res(2020, 7, 4)?, "Independence Day"), @@ -638,14 +645,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 10, 12)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2021, 12, 31)?, @@ -684,14 +691,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 10, 11)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 5, 30)?, "Memorial Day"), ( @@ -722,14 +729,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 10, 10)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -760,14 +767,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 10, 9)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 5, 27)?, "Memorial Day"), ( @@ -790,14 +797,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 10, 14)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 5, 26)?, "Memorial Day"), ( @@ -820,14 +827,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 10, 13)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 5, 25)?, "Memorial Day"), ( @@ -854,14 +861,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 10, 12)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2027, 12, 31)?, @@ -900,14 +907,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 10, 11)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 5, 29)?, "Memorial Day"), ( @@ -934,14 +941,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 10, 9)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 5, 28)?, "Memorial Day"), ( @@ -968,14 +975,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 10, 8)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 5, 27)?, "Memorial Day"), ( @@ -998,8 +1005,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 10, 14)?, "Columbus Day"), ], &mut map, - Country::US, - "United States", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/us_ak.rs b/src/data/us_ak.rs new file mode 100644 index 0000000..aa6d4a7 --- /dev/null +++ b/src/data/us_ak.rs @@ -0,0 +1,425 @@ +//! United States (Alaska) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Alaska)"; +const COUNTY_CODE: Country = Country::US_AK; + +/// Generate holiday map for United States (Alaska). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 3, 27)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2000, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 3, 26)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2001, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 3, 25)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2002, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 3, 31)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2003, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2003, 10, 17)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 3, 29)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2004, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 3, 28)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2005, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 3, 27)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2006, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 3, 26)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2007, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 31)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2008, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2008, 10, 17)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 3, 30)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2009, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2009, 10, 19)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 3, 29)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2010, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 3, 28)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2011, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 3, 26)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2012, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 25)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2013, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 3, 31)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2014, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2014, 10, 17)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 3, 30)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2015, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2015, 10, 19)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 28)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2016, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 3, 27)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2017, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 26)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2018, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 3, 25)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2019, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 3, 30)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2020, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2020, 10, 19)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 3, 29)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2021, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 3, 28)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2022, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 3, 27)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2023, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 25)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2024, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 3, 31)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2025, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2025, 10, 17)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 3, 30)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2026, 10, 18)?, "Alaska Day"), + ( + NaiveDate::from_ymd_res(2026, 10, 19)?, + "Alaska Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 29)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2027, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 3, 27)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2028, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 26)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2029, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 3, 25)?, "Seward's Day"), + (NaiveDate::from_ymd_res(2030, 10, 18)?, "Alaska Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_al.rs b/src/data/us_al.rs new file mode 100644 index 0000000..db7f20e --- /dev/null +++ b/src/data/us_al.rs @@ -0,0 +1,579 @@ +//! United States (Alabama) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Alabama)"; +const COUNTY_CODE: Country = Country::US_AL; + +/// Generate holiday map for United States (Alabama). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + ( + NaiveDate::from_ymd_res(2000, 4, 24)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2000, 6, 5)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + ( + NaiveDate::from_ymd_res(2001, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2001, 6, 4)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + ( + NaiveDate::from_ymd_res(2002, 4, 22)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2002, 6, 3)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + ( + NaiveDate::from_ymd_res(2003, 4, 28)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2003, 6, 2)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + ( + NaiveDate::from_ymd_res(2004, 4, 26)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2004, 6, 7)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + ( + NaiveDate::from_ymd_res(2005, 4, 25)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2005, 6, 6)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + ( + NaiveDate::from_ymd_res(2006, 4, 24)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2006, 6, 5)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + ( + NaiveDate::from_ymd_res(2007, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2007, 6, 4)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + ( + NaiveDate::from_ymd_res(2008, 4, 28)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2008, 6, 2)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + ( + NaiveDate::from_ymd_res(2009, 4, 27)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2009, 6, 1)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + ( + NaiveDate::from_ymd_res(2010, 4, 26)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2010, 6, 7)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + ( + NaiveDate::from_ymd_res(2011, 4, 25)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2011, 6, 6)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + ( + NaiveDate::from_ymd_res(2012, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2012, 6, 4)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + ( + NaiveDate::from_ymd_res(2013, 4, 22)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2013, 6, 3)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 4, 28)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2014, 6, 2)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 4, 27)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2015, 6, 1)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + ( + NaiveDate::from_ymd_res(2016, 4, 25)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2016, 6, 6)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + ( + NaiveDate::from_ymd_res(2017, 4, 24)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2017, 6, 5)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + ( + NaiveDate::from_ymd_res(2018, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2018, 6, 4)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + ( + NaiveDate::from_ymd_res(2019, 4, 22)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2019, 6, 3)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + ( + NaiveDate::from_ymd_res(2020, 4, 27)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2020, 6, 1)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + ( + NaiveDate::from_ymd_res(2021, 4, 26)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2021, 6, 7)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + ( + NaiveDate::from_ymd_res(2022, 4, 25)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2022, 6, 6)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 4, 24)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2023, 6, 5)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 4, 22)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2024, 6, 3)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 4, 28)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2025, 6, 2)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 4, 27)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2026, 6, 1)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + ( + NaiveDate::from_ymd_res(2027, 4, 26)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2027, 6, 7)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 4, 24)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2028, 6, 5)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2029, 6, 4)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 4, 22)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2030, 6, 3)?, + "Jefferson Davis Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ar.rs b/src/data/us_ar.rs new file mode 100644 index 0000000..39e4bab --- /dev/null +++ b/src/data/us_ar.rs @@ -0,0 +1,83 @@ +//! United States (Arkansas) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Arkansas)"; +const COUNTY_CODE: Country = Country::US_AR; + +/// Generate holiday map for United States (Arkansas). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_as.rs b/src/data/us_as.rs new file mode 100644 index 0000000..c6c1e9d --- /dev/null +++ b/src/data/us_as.rs @@ -0,0 +1,366 @@ +//! United States (American Samoa) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (American Samoa)"; +const COUNTY_CODE: Country = Country::US_AS; + +/// Generate holiday map for United States (American Samoa). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2000, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2005, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2006, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [( + NaiveDate::from_ymd_res(2010, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2011, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2017, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2023, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2028, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_az.rs b/src/data/us_az.rs new file mode 100644 index 0000000..73dd9ed --- /dev/null +++ b/src/data/us_az.rs @@ -0,0 +1,83 @@ +//! United States (Arizona) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Arizona)"; +const COUNTY_CODE: Country = Country::US_AZ; + +/// Generate holiday map for United States (Arizona). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_ca.rs b/src/data/us_ca.rs new file mode 100644 index 0000000..80caf29 --- /dev/null +++ b/src/data/us_ca.rs @@ -0,0 +1,584 @@ +//! United States (California) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (California)"; +const COUNTY_CODE: Country = Country::US_CA; + +/// Generate holiday map for United States (California). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2000, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2000, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2001, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2002, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2002, 4, 1)?, + "Cesar Chavez Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2003, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2004, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2005, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2005, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2006, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2006, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2007, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2008, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2009, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2013, 4, 1)?, + "Cesar Chavez Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2014, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2015, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + ( + NaiveDate::from_ymd_res(2017, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2017, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + ( + NaiveDate::from_ymd_res(2018, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2018, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + ( + NaiveDate::from_ymd_res(2019, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2019, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2019, 4, 1)?, + "Cesar Chavez Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + ( + NaiveDate::from_ymd_res(2020, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2020, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + ( + NaiveDate::from_ymd_res(2022, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2022, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2023, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2024, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2024, 4, 1)?, + "Cesar Chavez Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2025, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2026, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2028, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2029, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2030, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2030, 4, 1)?, + "Cesar Chavez Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_co.rs b/src/data/us_co.rs new file mode 100644 index 0000000..02ee764 --- /dev/null +++ b/src/data/us_co.rs @@ -0,0 +1,293 @@ +//! United States (Colorado) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Colorado)"; +const COUNTY_CODE: Country = Country::US_CO; + +/// Generate holiday map for United States (Colorado). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 3, 31)?, "Cesar Chavez Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ct.rs b/src/data/us_ct.rs new file mode 100644 index 0000000..7240bb6 --- /dev/null +++ b/src/data/us_ct.rs @@ -0,0 +1,429 @@ +//! United States (Connecticut) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Connecticut)"; +const COUNTY_CODE: Country = Country::US_CT; + +/// Generate holiday map for United States (Connecticut). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2000, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2005, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2006, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2011, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2012, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2017, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2022, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2023, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2028, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_dc.rs b/src/data/us_dc.rs new file mode 100644 index 0000000..e4dda71 --- /dev/null +++ b/src/data/us_dc.rs @@ -0,0 +1,334 @@ +//! United States (District of Columbia) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (District of Columbia)"; +const COUNTY_CODE: Country = Country::US_DC; + +/// Generate holiday map for United States (District of Columbia). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 1, 20)?, "Inauguration Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2005, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2005, 4, 15)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2006, 4, 17)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2009, 4, 16)?, "Emancipation Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2011, 4, 15)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2013, 4, 16)?, "Emancipation Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2016, 4, 15)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2017, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2017, 4, 17)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2021, 4, 16)?, "Emancipation Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2022, 4, 15)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2023, 4, 17)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 4, 16)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2028, 4, 17)?, + "Emancipation Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2029, 4, 16)?, "Emancipation Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 4, 16)?, "Emancipation Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_de.rs b/src/data/us_de.rs new file mode 100644 index 0000000..6d4e1c1 --- /dev/null +++ b/src/data/us_de.rs @@ -0,0 +1,498 @@ +//! United States (Delaware) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Delaware)"; +const COUNTY_CODE: Country = Country::US_DE; + +/// Generate holiday map for United States (Delaware). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_fl.rs b/src/data/us_fl.rs new file mode 100644 index 0000000..260c1e6 --- /dev/null +++ b/src/data/us_fl.rs @@ -0,0 +1,495 @@ +//! United States (Florida) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Florida)"; +const COUNTY_CODE: Country = Country::US_FL; + +/// Generate holiday map for United States (Florida). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + ( + NaiveDate::from_ymd_res(2011, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + ( + NaiveDate::from_ymd_res(2012, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + ( + NaiveDate::from_ymd_res(2013, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + ( + NaiveDate::from_ymd_res(2017, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + ( + NaiveDate::from_ymd_res(2018, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + ( + NaiveDate::from_ymd_res(2019, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + ( + NaiveDate::from_ymd_res(2020, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + ( + NaiveDate::from_ymd_res(2022, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Friday After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 2, 15)?, + "Susan B. Anthony Day", + ), + ( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Friday After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ga.rs b/src/data/us_ga.rs new file mode 100644 index 0000000..444773a --- /dev/null +++ b/src/data/us_ga.rs @@ -0,0 +1,597 @@ +//! United States (Georgia) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Georgia)"; +const COUNTY_CODE: Country = Country::US_GA; + +/// Generate holiday map for United States (Georgia). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + ( + NaiveDate::from_ymd_res(2000, 4, 24)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2000, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + ( + NaiveDate::from_ymd_res(2001, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2001, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + ( + NaiveDate::from_ymd_res(2002, 4, 22)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2002, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + ( + NaiveDate::from_ymd_res(2003, 4, 28)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2003, 12, 26)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + ( + NaiveDate::from_ymd_res(2004, 4, 26)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Robert E. Lee's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + ( + NaiveDate::from_ymd_res(2005, 4, 25)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2005, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + ( + NaiveDate::from_ymd_res(2006, 4, 24)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2006, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + ( + NaiveDate::from_ymd_res(2007, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2007, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + ( + NaiveDate::from_ymd_res(2008, 4, 28)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2008, 12, 26)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + ( + NaiveDate::from_ymd_res(2009, 4, 27)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2009, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + ( + NaiveDate::from_ymd_res(2010, 4, 26)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Robert E. Lee's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + ( + NaiveDate::from_ymd_res(2011, 4, 25)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2011, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + ( + NaiveDate::from_ymd_res(2012, 4, 23)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2012, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + ( + NaiveDate::from_ymd_res(2013, 4, 22)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2013, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 4, 28)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2014, 12, 26)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 4, 27)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Robert E. Lee's Birthday", + ), + ( + NaiveDate::from_ymd_res(2015, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 4, 25)?, "State Holiday"), + (NaiveDate::from_ymd_res(2016, 11, 25)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2016, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 4, 24)?, "State Holiday"), + (NaiveDate::from_ymd_res(2017, 11, 24)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2017, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 4, 23)?, "State Holiday"), + (NaiveDate::from_ymd_res(2018, 11, 23)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2018, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 4, 22)?, "State Holiday"), + (NaiveDate::from_ymd_res(2019, 11, 29)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2019, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 4, 10)?, "State Holiday"), + (NaiveDate::from_ymd_res(2020, 11, 27)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2020, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 4, 26)?, "State Holiday"), + (NaiveDate::from_ymd_res(2021, 11, 26)?, "State Holiday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 4, 25)?, "State Holiday"), + (NaiveDate::from_ymd_res(2022, 11, 25)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2022, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 4, 24)?, "State Holiday"), + (NaiveDate::from_ymd_res(2023, 11, 24)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2023, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 4, 22)?, "State Holiday"), + (NaiveDate::from_ymd_res(2024, 11, 29)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2024, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 4, 28)?, "State Holiday"), + (NaiveDate::from_ymd_res(2025, 11, 28)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2025, 12, 26)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 4, 27)?, "State Holiday"), + (NaiveDate::from_ymd_res(2026, 11, 27)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2026, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 4, 26)?, "State Holiday"), + (NaiveDate::from_ymd_res(2027, 11, 26)?, "State Holiday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 4, 24)?, "State Holiday"), + (NaiveDate::from_ymd_res(2028, 11, 24)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2028, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 4, 23)?, "State Holiday"), + (NaiveDate::from_ymd_res(2029, 11, 23)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2029, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 4, 22)?, "State Holiday"), + (NaiveDate::from_ymd_res(2030, 11, 29)?, "State Holiday"), + ( + NaiveDate::from_ymd_res(2030, 12, 24)?, + "Washington's Birthday", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_gu.rs b/src/data/us_gu.rs new file mode 100644 index 0000000..cefc0b8 --- /dev/null +++ b/src/data/us_gu.rs @@ -0,0 +1,579 @@ +//! United States (Guam) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Guam)"; +const COUNTY_CODE: Country = Country::US_GU; + +/// Generate holiday map for United States (Guam). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 3, 6)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2000, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2000, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2000, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 3, 5)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2001, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2001, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2001, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 3, 4)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2002, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2002, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2002, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 3, 3)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2003, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2003, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2003, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 3, 1)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2004, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2004, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2004, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 3, 7)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2005, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2005, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2005, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 3, 6)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2006, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2006, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2006, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 3, 5)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2007, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2007, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2007, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 3)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2008, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2008, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2008, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 3, 2)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2009, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2009, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2009, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 3, 1)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2010, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2010, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 3, 7)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2011, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2011, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2011, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 3, 5)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2012, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2012, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2012, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 4)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2013, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2013, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2013, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 3, 3)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2014, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2014, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2014, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 3, 2)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2015, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2015, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2015, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 7)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2016, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2016, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2016, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 3, 6)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2017, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2017, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2017, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 5)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2018, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2018, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2018, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 3, 4)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2019, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2019, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2019, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 3, 2)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2020, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2020, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2020, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 3, 1)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2021, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2021, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2021, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 3, 7)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2022, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2022, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2022, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 3, 6)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2023, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2023, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2023, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 4)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2024, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2024, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2024, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 3, 3)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2025, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2025, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2025, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 3, 2)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2026, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2026, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2026, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 1)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2027, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2027, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2027, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 3, 6)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2028, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2028, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2028, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 5)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2029, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2029, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2029, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 3, 4)?, "Guam Discovery Day"), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2030, 7, 21)?, + "Liberation Day (Guam)", + ), + (NaiveDate::from_ymd_res(2030, 11, 2)?, "All Souls' Day"), + (NaiveDate::from_ymd_res(2030, 12, 8)?, "Lady of Camarin Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_hi.rs b/src/data/us_hi.rs new file mode 100644 index 0000000..f280d13 --- /dev/null +++ b/src/data/us_hi.rs @@ -0,0 +1,589 @@ +//! United States (Hawaii) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Hawaii)"; +const COUNTY_CODE: Country = Country::US_HI; + +/// Generate holiday map for United States (Hawaii). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + ( + NaiveDate::from_ymd_res(2000, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2000, 3, 27)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2000, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2000, 8, 18)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + ( + NaiveDate::from_ymd_res(2001, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2001, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2001, 8, 17)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + ( + NaiveDate::from_ymd_res(2002, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2002, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2002, 8, 16)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + ( + NaiveDate::from_ymd_res(2003, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2003, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2003, 8, 15)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + ( + NaiveDate::from_ymd_res(2004, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2004, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2004, 8, 20)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + ( + NaiveDate::from_ymd_res(2005, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2005, 3, 25)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2005, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2005, 8, 19)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + ( + NaiveDate::from_ymd_res(2006, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2006, 3, 27)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2006, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2006, 8, 18)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + ( + NaiveDate::from_ymd_res(2007, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2007, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2007, 8, 17)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + ( + NaiveDate::from_ymd_res(2008, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2008, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2008, 8, 15)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + ( + NaiveDate::from_ymd_res(2009, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2009, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2009, 8, 21)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + ( + NaiveDate::from_ymd_res(2010, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2010, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2010, 8, 20)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + ( + NaiveDate::from_ymd_res(2011, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2011, 3, 25)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2011, 6, 11)?, "Kamehameha Day"), + ( + NaiveDate::from_ymd_res(2011, 6, 10)?, + "Kamehameha Day (observed)", + ), + (NaiveDate::from_ymd_res(2011, 8, 19)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + ( + NaiveDate::from_ymd_res(2012, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2012, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2012, 8, 17)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + ( + NaiveDate::from_ymd_res(2013, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2013, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2013, 8, 16)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2014, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2014, 8, 15)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2015, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2015, 8, 21)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + ( + NaiveDate::from_ymd_res(2016, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2016, 3, 25)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2016, 6, 11)?, "Kamehameha Day"), + ( + NaiveDate::from_ymd_res(2016, 6, 10)?, + "Kamehameha Day (observed)", + ), + (NaiveDate::from_ymd_res(2016, 8, 19)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + ( + NaiveDate::from_ymd_res(2017, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2017, 3, 27)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2017, 6, 11)?, "Kamehameha Day"), + ( + NaiveDate::from_ymd_res(2017, 6, 12)?, + "Kamehameha Day (observed)", + ), + (NaiveDate::from_ymd_res(2017, 8, 18)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + ( + NaiveDate::from_ymd_res(2018, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2018, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2018, 8, 17)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + ( + NaiveDate::from_ymd_res(2019, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2019, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2019, 8, 16)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + ( + NaiveDate::from_ymd_res(2020, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2020, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2020, 8, 21)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + ( + NaiveDate::from_ymd_res(2021, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2021, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2021, 8, 20)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + ( + NaiveDate::from_ymd_res(2022, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2022, 3, 25)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2022, 6, 11)?, "Kamehameha Day"), + ( + NaiveDate::from_ymd_res(2022, 6, 10)?, + "Kamehameha Day (observed)", + ), + (NaiveDate::from_ymd_res(2022, 8, 19)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2023, 3, 27)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2023, 6, 11)?, "Kamehameha Day"), + ( + NaiveDate::from_ymd_res(2023, 6, 12)?, + "Kamehameha Day (observed)", + ), + (NaiveDate::from_ymd_res(2023, 8, 18)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2024, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2024, 8, 16)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2025, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2025, 8, 15)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2026, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2026, 8, 21)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + ( + NaiveDate::from_ymd_res(2027, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2027, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2027, 8, 20)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + ( + NaiveDate::from_ymd_res(2028, 3, 27)?, + "Prince Jonah Kuhio Kalanianaole Day (observed)", + ), + (NaiveDate::from_ymd_res(2028, 6, 11)?, "Kamehameha Day"), + ( + NaiveDate::from_ymd_res(2028, 6, 12)?, + "Kamehameha Day (observed)", + ), + (NaiveDate::from_ymd_res(2028, 8, 18)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2029, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2029, 8, 17)?, "Statehood Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 3, 26)?, + "Prince Jonah Kuhio Kalanianaole Day", + ), + (NaiveDate::from_ymd_res(2030, 6, 11)?, "Kamehameha Day"), + (NaiveDate::from_ymd_res(2030, 8, 16)?, "Statehood Day"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ia.rs b/src/data/us_ia.rs new file mode 100644 index 0000000..80fcfa1 --- /dev/null +++ b/src/data/us_ia.rs @@ -0,0 +1,354 @@ +//! United States (Iowa) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Iowa)"; +const COUNTY_CODE: Country = Country::US_IA; + +/// Generate holiday map for United States (Iowa). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2000, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2005, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2006, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2011, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2012, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2017, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2022, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2023, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2028, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_id.rs b/src/data/us_id.rs new file mode 100644 index 0000000..6754778 --- /dev/null +++ b/src/data/us_id.rs @@ -0,0 +1,83 @@ +//! United States (Idaho) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Idaho)"; +const COUNTY_CODE: Country = Country::US_ID; + +/// Generate holiday map for United States (Idaho). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_il.rs b/src/data/us_il.rs new file mode 100644 index 0000000..52f7c6f --- /dev/null +++ b/src/data/us_il.rs @@ -0,0 +1,441 @@ +//! United States (Illinois) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Illinois)"; +const COUNTY_CODE: Country = Country::US_IL; + +/// Generate holiday map for United States (Illinois). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2000, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2000, 3, 6)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2001, 3, 5)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2002, 3, 4)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2003, 3, 3)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2004, 3, 1)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2005, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2005, 3, 7)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2006, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2006, 3, 6)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2007, 3, 5)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2008, 3, 3)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2009, 3, 2)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2010, 3, 1)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2011, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2011, 3, 7)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2012, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2012, 3, 5)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2013, 3, 4)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2014, 3, 3)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2015, 3, 2)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2016, 3, 7)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2017, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2017, 3, 6)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2018, 3, 5)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2019, 3, 4)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2020, 3, 2)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2021, 3, 1)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2022, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2022, 3, 7)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2023, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2023, 3, 6)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2024, 3, 4)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2025, 3, 3)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2026, 3, 2)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2027, 3, 1)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2028, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2028, 3, 6)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2029, 3, 5)?, "Casimir Pulaski Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2030, 3, 4)?, "Casimir Pulaski Day"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_in.rs b/src/data/us_in.rs new file mode 100644 index 0000000..61a1a19 --- /dev/null +++ b/src/data/us_in.rs @@ -0,0 +1,408 @@ +//! United States (Indiana) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Indiana)"; +const COUNTY_CODE: Country = Country::US_IN; + +/// Generate holiday map for United States (Indiana). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2006, 5, 2)?, "Primary Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2008, 5, 6)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 5, 4)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + (NaiveDate::from_ymd_res(2010, 11, 26)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + (NaiveDate::from_ymd_res(2011, 11, 25)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 5, 8)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + (NaiveDate::from_ymd_res(2012, 11, 23)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2013, 11, 29)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 5, 6)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + (NaiveDate::from_ymd_res(2014, 11, 28)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2015, 5, 5)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2015, 11, 3)?, "Election Day"), + (NaiveDate::from_ymd_res(2015, 11, 27)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 5, 3)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + (NaiveDate::from_ymd_res(2016, 11, 25)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2017, 5, 2)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2017, 11, 7)?, "Election Day"), + (NaiveDate::from_ymd_res(2017, 11, 24)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 5, 8)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + (NaiveDate::from_ymd_res(2018, 11, 23)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2019, 5, 7)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2019, 11, 5)?, "Election Day"), + (NaiveDate::from_ymd_res(2019, 11, 29)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 5, 5)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + (NaiveDate::from_ymd_res(2020, 11, 27)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2021, 5, 4)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2021, 11, 2)?, "Election Day"), + (NaiveDate::from_ymd_res(2021, 11, 26)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 5, 3)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + (NaiveDate::from_ymd_res(2022, 11, 25)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + (NaiveDate::from_ymd_res(2023, 5, 2)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2023, 11, 7)?, "Election Day"), + (NaiveDate::from_ymd_res(2023, 11, 24)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 5, 7)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + (NaiveDate::from_ymd_res(2024, 11, 29)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2025, 5, 6)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2025, 11, 4)?, "Election Day"), + (NaiveDate::from_ymd_res(2025, 11, 28)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 5, 5)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + (NaiveDate::from_ymd_res(2026, 11, 27)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + (NaiveDate::from_ymd_res(2027, 5, 4)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2027, 11, 2)?, "Election Day"), + (NaiveDate::from_ymd_res(2027, 11, 26)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 5, 2)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + (NaiveDate::from_ymd_res(2028, 11, 24)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2029, 5, 8)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2029, 11, 6)?, "Election Day"), + (NaiveDate::from_ymd_res(2029, 11, 23)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 5, 7)?, "Primary Election Day"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + (NaiveDate::from_ymd_res(2030, 11, 29)?, "Lincoln's Birthday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ks.rs b/src/data/us_ks.rs new file mode 100644 index 0000000..0a51c52 --- /dev/null +++ b/src/data/us_ks.rs @@ -0,0 +1,245 @@ +//! United States (Kansas) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Kansas)"; +const COUNTY_CODE: Country = Country::US_KS; + +/// Generate holiday map for United States (Kansas). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2017, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2023, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2028, 12, 22)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 12, 24)?, "Christmas Eve")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ky.rs b/src/data/us_ky.rs new file mode 100644 index 0000000..4cdb298 --- /dev/null +++ b/src/data/us_ky.rs @@ -0,0 +1,356 @@ +//! United States (Kentucky) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Kentucky)"; +const COUNTY_CODE: Country = Country::US_KY; + +/// Generate holiday map for United States (Kentucky). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2013, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2015, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 12, 31)?, "New Year's Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 30)?, + "New Year's Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2017, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2019, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 12, 31)?, "New Year's Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 30)?, + "New Year's Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + (NaiveDate::from_ymd_res(2023, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2025, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2029, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_la.rs b/src/data/us_la.rs new file mode 100644 index 0000000..2e9bbc6 --- /dev/null +++ b/src/data/us_la.rs @@ -0,0 +1,412 @@ +//! United States (Louisiana) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Louisiana)"; +const COUNTY_CODE: Country = Country::US_LA; + +/// Generate holiday map for United States (Louisiana). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 3, 7)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2001, 2, 27)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 2, 12)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 3, 4)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 2, 24)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2005, 2, 8)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 2, 28)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 2, 20)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 2, 5)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2009, 2, 24)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 2, 16)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 3, 8)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 2, 21)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2013, 2, 12)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 3, 4)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 2, 17)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 2, 9)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2017, 2, 28)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 2, 13)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 3, 5)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 2, 25)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2021, 2, 16)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 3, 1)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 2, 21)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 2, 13)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 3, 4)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 2, 17)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 2, 9)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 2, 29)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 20)?, "Inauguration Day"), + (NaiveDate::from_ymd_res(2029, 2, 13)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 3, 5)?, "Mardi Gras"), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ma.rs b/src/data/us_ma.rs new file mode 100644 index 0000000..7f51ef1 --- /dev/null +++ b/src/data/us_ma.rs @@ -0,0 +1,433 @@ +//! United States (Massachusetts) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Massachusetts)"; +const COUNTY_CODE: Country = Country::US_MA; + +/// Generate holiday map for United States (Massachusetts). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2000, 4, 17)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2001, 3, 19)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2001, 4, 16)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2002, 3, 18)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2002, 4, 15)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2003, 4, 21)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2004, 4, 19)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2005, 4, 18)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2006, 4, 17)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2007, 3, 19)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2007, 4, 16)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2008, 4, 21)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2009, 4, 20)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2010, 4, 19)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2011, 4, 18)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2012, 3, 19)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2012, 4, 16)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2013, 3, 18)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2013, 4, 15)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2014, 4, 21)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2015, 4, 20)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2016, 4, 18)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2017, 4, 17)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2018, 3, 19)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2018, 4, 16)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2019, 3, 18)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2019, 4, 15)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2020, 4, 20)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2021, 4, 19)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2022, 4, 18)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2023, 4, 17)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2024, 3, 18)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2024, 4, 15)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2025, 4, 21)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2026, 4, 20)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2027, 4, 19)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 3, 17)?, "Evacuation Day"), + (NaiveDate::from_ymd_res(2028, 4, 17)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2029, 3, 19)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2029, 4, 16)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 3, 17)?, "Evacuation Day"), + ( + NaiveDate::from_ymd_res(2030, 3, 18)?, + "Evacuation Day (observed)", + ), + (NaiveDate::from_ymd_res(2030, 4, 15)?, "Patriots' Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_md.rs b/src/data/us_md.rs new file mode 100644 index 0000000..4066f38 --- /dev/null +++ b/src/data/us_md.rs @@ -0,0 +1,342 @@ +//! United States (Maryland) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Maryland)"; +const COUNTY_CODE: Country = Country::US_MD; + +/// Generate holiday map for United States (Maryland). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 1, 20)?, "Inauguration Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 1, 20)?, "Inauguration Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2008, + [( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 20)?, "Inauguration Day"), + ( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "American Indian Heritage Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 20)?, "Inauguration Day"), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "American Indian Heritage Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 20)?, "Inauguration Day"), + ( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "American Indian Heritage Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 20)?, "Inauguration Day"), + ( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "American Indian Heritage Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 20)?, "Inauguration Day"), + ( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "American Indian Heritage Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "American Indian Heritage Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_me.rs b/src/data/us_me.rs new file mode 100644 index 0000000..40272fa --- /dev/null +++ b/src/data/us_me.rs @@ -0,0 +1,300 @@ +//! United States (Maine) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Maine)"; +const COUNTY_CODE: Country = Country::US_ME; + +/// Generate holiday map for United States (Maine). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 4, 17)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 4, 16)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 4, 15)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 4, 21)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 4, 19)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 4, 18)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 4, 17)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 4, 16)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 4, 21)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 4, 20)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 4, 19)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 4, 18)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 4, 16)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 4, 15)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 4, 21)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 4, 20)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 4, 18)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 4, 17)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 4, 16)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 4, 15)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 4, 20)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 4, 19)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 4, 18)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 4, 17)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 4, 15)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 4, 21)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 4, 20)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 4, 19)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 4, 17)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 4, 16)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 4, 15)?, "Patriots' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_mi.rs b/src/data/us_mi.rs new file mode 100644 index 0000000..767c366 --- /dev/null +++ b/src/data/us_mi.rs @@ -0,0 +1,291 @@ +//! United States (Michigan) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Michigan)"; +const COUNTY_CODE: Country = Country::US_MI; + +/// Generate holiday map for United States (Michigan). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2013, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2014, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2015, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 23)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2016, 12, 31)?, "New Year's Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 30)?, + "New Year's Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2017, 12, 22)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2017, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2018, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2019, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2020, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 23)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2022, 12, 31)?, "New Year's Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 30)?, + "New Year's Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2023, 12, 22)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2023, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2024, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2025, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2026, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2028, 12, 22)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2028, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2029, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2030, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_mn.rs b/src/data/us_mn.rs new file mode 100644 index 0000000..95c3c9d --- /dev/null +++ b/src/data/us_mn.rs @@ -0,0 +1,83 @@ +//! United States (Minnesota) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Minnesota)"; +const COUNTY_CODE: Country = Country::US_MN; + +/// Generate holiday map for United States (Minnesota). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_mo.rs b/src/data/us_mo.rs new file mode 100644 index 0000000..4c91baf --- /dev/null +++ b/src/data/us_mo.rs @@ -0,0 +1,348 @@ +//! United States (Missouri) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Missouri)"; +const COUNTY_CODE: Country = Country::US_MO; + +/// Generate holiday map for United States (Missouri). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2004, 5, 7)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2005, 5, 9)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2010, 5, 7)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2011, 5, 9)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2016, 5, 9)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2021, 5, 7)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2022, 5, 9)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 5, 8)?, "Truman Day"), + ( + NaiveDate::from_ymd_res(2027, 5, 7)?, + "Truman Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 5, 8)?, "Truman Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_mp.rs b/src/data/us_mp.rs new file mode 100644 index 0000000..8d18816 --- /dev/null +++ b/src/data/us_mp.rs @@ -0,0 +1,684 @@ +//! United States (Northern Mariana Islands) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Northern Mariana Islands)"; +const COUNTY_CODE: Country = Country::US_MP; + +/// Generate holiday map for United States (Northern Mariana Islands). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + ( + NaiveDate::from_ymd_res(2000, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2000, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2000, 11, 3)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2000, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + ( + NaiveDate::from_ymd_res(2001, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2001, 3, 23)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + (NaiveDate::from_ymd_res(2001, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2001, 11, 5)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2001, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2001, 12, 7)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + ( + NaiveDate::from_ymd_res(2002, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2002, 3, 25)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2002, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2002, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2002, 12, 9)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + ( + NaiveDate::from_ymd_res(2003, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2003, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2003, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + ( + NaiveDate::from_ymd_res(2004, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + (NaiveDate::from_ymd_res(2004, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2004, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + ( + NaiveDate::from_ymd_res(2005, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2005, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2005, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + ( + NaiveDate::from_ymd_res(2006, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2006, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2006, 11, 3)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2006, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + ( + NaiveDate::from_ymd_res(2007, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2007, 3, 23)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2007, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2007, 11, 5)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2007, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2007, 12, 7)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + ( + NaiveDate::from_ymd_res(2008, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2008, 11, 4)?, + "Citizenship Day; Election Day", + ), + (NaiveDate::from_ymd_res(2008, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + ( + NaiveDate::from_ymd_res(2009, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2009, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2009, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + ( + NaiveDate::from_ymd_res(2010, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + (NaiveDate::from_ymd_res(2010, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2010, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + ( + NaiveDate::from_ymd_res(2011, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + (NaiveDate::from_ymd_res(2011, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2011, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + ( + NaiveDate::from_ymd_res(2012, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2012, 3, 23)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + (NaiveDate::from_ymd_res(2012, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2012, 11, 5)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2012, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2012, 12, 7)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + ( + NaiveDate::from_ymd_res(2013, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2013, 3, 25)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2013, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2013, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2013, 12, 9)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2014, 11, 4)?, + "Citizenship Day; Election Day", + ), + (NaiveDate::from_ymd_res(2014, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2015, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2015, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + ( + NaiveDate::from_ymd_res(2016, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + (NaiveDate::from_ymd_res(2016, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2016, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + ( + NaiveDate::from_ymd_res(2017, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2017, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2017, 11, 3)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2017, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + ( + NaiveDate::from_ymd_res(2018, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2018, 3, 23)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + (NaiveDate::from_ymd_res(2018, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2018, 11, 5)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2018, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2018, 12, 7)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + ( + NaiveDate::from_ymd_res(2019, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2019, 3, 25)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2019, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2019, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2019, 12, 9)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + ( + NaiveDate::from_ymd_res(2020, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + (NaiveDate::from_ymd_res(2020, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2020, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + ( + NaiveDate::from_ymd_res(2021, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2021, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2021, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + ( + NaiveDate::from_ymd_res(2022, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + (NaiveDate::from_ymd_res(2022, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2022, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + (NaiveDate::from_ymd_res(2023, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2023, 11, 3)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2023, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2024, 3, 25)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + (NaiveDate::from_ymd_res(2024, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2024, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2024, 12, 9)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2025, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2025, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + (NaiveDate::from_ymd_res(2026, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2026, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + ( + NaiveDate::from_ymd_res(2027, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + (NaiveDate::from_ymd_res(2027, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2027, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 3, 24)?, + "Commonwealth Covenant Day", + ), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + (NaiveDate::from_ymd_res(2028, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2028, 11, 3)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2028, 12, 8)?, "Constitution Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2029, 3, 23)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2029, 11, 4)?, "Citizenship Day"), + ( + NaiveDate::from_ymd_res(2029, 11, 5)?, + "Citizenship Day (observed)", + ), + (NaiveDate::from_ymd_res(2029, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2029, 12, 7)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 3, 24)?, + "Commonwealth Covenant Day", + ), + ( + NaiveDate::from_ymd_res(2030, 3, 25)?, + "Commonwealth Covenant Day (observed)", + ), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + (NaiveDate::from_ymd_res(2030, 11, 4)?, "Citizenship Day"), + (NaiveDate::from_ymd_res(2030, 12, 8)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2030, 12, 9)?, + "Constitution Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ms.rs b/src/data/us_ms.rs new file mode 100644 index 0000000..607c03d --- /dev/null +++ b/src/data/us_ms.rs @@ -0,0 +1,393 @@ +//! United States (Mississippi) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Mississippi)"; +const COUNTY_CODE: Country = Country::US_MS; + +/// Generate holiday map for United States (Mississippi). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [( + NaiveDate::from_ymd_res(2000, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [( + NaiveDate::from_ymd_res(2001, 4, 30)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [( + NaiveDate::from_ymd_res(2002, 4, 29)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [( + NaiveDate::from_ymd_res(2003, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [( + NaiveDate::from_ymd_res(2005, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [( + NaiveDate::from_ymd_res(2006, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [( + NaiveDate::from_ymd_res(2007, 4, 30)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [( + NaiveDate::from_ymd_res(2008, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [( + NaiveDate::from_ymd_res(2009, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [( + NaiveDate::from_ymd_res(2010, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [( + NaiveDate::from_ymd_res(2011, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [( + NaiveDate::from_ymd_res(2012, 4, 30)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [( + NaiveDate::from_ymd_res(2013, 4, 29)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [( + NaiveDate::from_ymd_res(2014, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [( + NaiveDate::from_ymd_res(2015, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [( + NaiveDate::from_ymd_res(2016, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [( + NaiveDate::from_ymd_res(2017, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [( + NaiveDate::from_ymd_res(2018, 4, 30)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [( + NaiveDate::from_ymd_res(2019, 4, 29)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [( + NaiveDate::from_ymd_res(2020, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [( + NaiveDate::from_ymd_res(2022, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [( + NaiveDate::from_ymd_res(2023, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [( + NaiveDate::from_ymd_res(2024, 4, 29)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [( + NaiveDate::from_ymd_res(2025, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [( + NaiveDate::from_ymd_res(2026, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [( + NaiveDate::from_ymd_res(2028, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [( + NaiveDate::from_ymd_res(2029, 4, 30)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [( + NaiveDate::from_ymd_res(2030, 4, 29)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_mt.rs b/src/data/us_mt.rs new file mode 100644 index 0000000..fb4e7bd --- /dev/null +++ b/src/data/us_mt.rs @@ -0,0 +1,167 @@ +//! United States (Montana) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Montana)"; +const COUNTY_CODE: Country = Country::US_MT; + +/// Generate holiday map for United States (Montana). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_nc.rs b/src/data/us_nc.rs new file mode 100644 index 0000000..5fb021b --- /dev/null +++ b/src/data/us_nc.rs @@ -0,0 +1,622 @@ +//! United States (North Carolina) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (North Carolina)"; +const COUNTY_CODE: Country = Country::US_NC; + +/// Generate holiday map for United States (North Carolina). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2013, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2013, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2014, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2014, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2015, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2015, 12, 26)?, + "Day After Christmas", + ), + ( + NaiveDate::from_ymd_res(2015, 12, 28)?, + "Day After Christmas (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2016, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2016, 12, 27)?, + "Day After Christmas (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2017, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2017, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2017, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2018, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2018, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2019, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2019, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2020, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2020, 12, 26)?, + "Day After Christmas", + ), + ( + NaiveDate::from_ymd_res(2020, 12, 28)?, + "Day After Christmas (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Day After Thanksgiving", + ), + ( + NaiveDate::from_ymd_res(2021, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2021, 12, 26)?, + "Day After Christmas", + ), + ( + NaiveDate::from_ymd_res(2021, 12, 27)?, + "Day After Christmas (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2022, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2022, 12, 27)?, + "Day After Christmas (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2023, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2023, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2024, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2024, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2025, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2025, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2026, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2026, 12, 26)?, + "Day After Christmas", + ), + ( + NaiveDate::from_ymd_res(2026, 12, 28)?, + "Day After Christmas (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Day After Thanksgiving", + ), + ( + NaiveDate::from_ymd_res(2027, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2027, 12, 26)?, + "Day After Christmas", + ), + ( + NaiveDate::from_ymd_res(2027, 12, 27)?, + "Day After Christmas (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2028, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2028, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2028, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2029, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2029, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + ( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Day After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2030, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2030, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_nd.rs b/src/data/us_nd.rs new file mode 100644 index 0000000..61e076f --- /dev/null +++ b/src/data/us_nd.rs @@ -0,0 +1,83 @@ +//! United States (North Dakota) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (North Dakota)"; +const COUNTY_CODE: Country = Country::US_ND; + +/// Generate holiday map for United States (North Dakota). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_ne.rs b/src/data/us_ne.rs new file mode 100644 index 0000000..d885411 --- /dev/null +++ b/src/data/us_ne.rs @@ -0,0 +1,300 @@ +//! United States (Nebraska) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Nebraska)"; +const COUNTY_CODE: Country = Country::US_NE; + +/// Generate holiday map for United States (Nebraska). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 4, 28)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 4, 27)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 4, 26)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 4, 25)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 4, 30)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 4, 29)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 4, 28)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 4, 27)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 4, 25)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 4, 24)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 4, 30)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 4, 29)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 4, 27)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 4, 26)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 4, 25)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 4, 24)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 4, 29)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 4, 28)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 4, 27)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 4, 26)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 4, 24)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 4, 30)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 4, 29)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 4, 28)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 4, 26)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 4, 25)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 4, 24)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 4, 30)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 4, 28)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 4, 27)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 4, 26)?, "Arbor Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_nh.rs b/src/data/us_nh.rs new file mode 100644 index 0000000..9c8417a --- /dev/null +++ b/src/data/us_nh.rs @@ -0,0 +1,429 @@ +//! United States (New Hampshire) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (New Hampshire)"; +const COUNTY_CODE: Country = Country::US_NH; + +/// Generate holiday map for United States (New Hampshire). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_nj.rs b/src/data/us_nj.rs new file mode 100644 index 0000000..13ca753 --- /dev/null +++ b/src/data/us_nj.rs @@ -0,0 +1,441 @@ +//! United States (New Jersey) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (New Jersey)"; +const COUNTY_CODE: Country = Country::US_NJ; + +/// Generate holiday map for United States (New Jersey). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2000, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2005, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2006, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2011, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2012, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2017, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2022, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2023, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2028, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_nm.rs b/src/data/us_nm.rs new file mode 100644 index 0000000..15fe210 --- /dev/null +++ b/src/data/us_nm.rs @@ -0,0 +1,300 @@ +//! United States (New Mexico) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (New Mexico)"; +const COUNTY_CODE: Country = Country::US_NM; + +/// Generate holiday map for United States (New Mexico). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 11, 24)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 11, 23)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 11, 29)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 11, 28)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 11, 26)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 11, 25)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 11, 24)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 11, 23)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 11, 28)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 11, 27)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 11, 26)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 11, 25)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 11, 23)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 11, 29)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 11, 28)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 11, 27)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 11, 25)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 11, 24)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 11, 23)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 11, 29)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 11, 27)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 11, 26)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 11, 25)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 11, 24)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 11, 29)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 11, 28)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 11, 27)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 11, 26)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 11, 24)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 11, 23)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 11, 29)?, "Presidents' Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_nv.rs b/src/data/us_nv.rs new file mode 100644 index 0000000..ae77925 --- /dev/null +++ b/src/data/us_nv.rs @@ -0,0 +1,393 @@ +//! United States (Nevada) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Nevada)"; +const COUNTY_CODE: Country = Country::US_NV; + +/// Generate holiday map for United States (Nevada). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 10, 27)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2000, 11, 24)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 10, 26)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2001, 11, 23)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 10, 25)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2002, 11, 29)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 10, 31)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2003, 11, 28)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 10, 29)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2004, 11, 26)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 10, 28)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2005, 11, 25)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 10, 27)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2006, 11, 24)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 10, 26)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2007, 11, 23)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 10, 31)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2008, 11, 28)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 10, 30)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2009, 11, 27)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 10, 29)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2010, 11, 26)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 10, 28)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2011, 11, 25)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 10, 26)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2012, 11, 23)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 10, 25)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2013, 11, 29)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 10, 31)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2014, 11, 28)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 10, 30)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2015, 11, 27)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 10, 28)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2016, 11, 25)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 10, 27)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2017, 11, 24)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 10, 26)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2018, 11, 23)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 10, 25)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2019, 11, 29)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 10, 30)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2020, 11, 27)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 10, 29)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2021, 11, 26)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 10, 28)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2022, 11, 25)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 10, 27)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2023, 11, 24)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 10, 25)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2024, 11, 29)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 10, 31)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2025, 11, 28)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 10, 30)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2026, 11, 27)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 10, 29)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2027, 11, 26)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 10, 27)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2028, 11, 24)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 10, 26)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2029, 11, 23)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 10, 25)?, "Nevada Day"), + (NaiveDate::from_ymd_res(2030, 11, 29)?, "Family Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ny.rs b/src/data/us_ny.rs new file mode 100644 index 0000000..10e8388 --- /dev/null +++ b/src/data/us_ny.rs @@ -0,0 +1,504 @@ +//! United States (New York) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (New York)"; +const COUNTY_CODE: Country = Country::US_NY; + +/// Generate holiday map for United States (New York). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2000, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 2, 12)?, "Lincoln's Birthday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2004, 2, 15)?, + "Susan B. Anthony Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2005, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2005, 2, 15)?, + "Susan B. Anthony Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2006, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2006, 2, 15)?, + "Susan B. Anthony Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2007, 2, 15)?, + "Susan B. Anthony Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2008, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2009, 2, 15)?, + "Susan B. Anthony Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2011, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2011, 2, 15)?, + "Susan B. Anthony Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2012, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2012, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2013, 2, 15)?, + "Susan B. Anthony Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2014, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2015, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2015, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2017, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2017, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2017, 11, 7)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2018, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2019, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2019, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2020, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2021, 11, 2)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2022, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2022, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2023, 2, 13)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2023, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2023, 11, 7)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2024, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2025, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2025, 11, 4)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2026, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 2, 12)?, "Lincoln's Birthday"), + (NaiveDate::from_ymd_res(2027, 11, 2)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2028, 2, 11)?, + "Lincoln's Birthday (observed)", + ), + ( + NaiveDate::from_ymd_res(2028, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2029, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2029, 11, 6)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 2, 12)?, "Lincoln's Birthday"), + ( + NaiveDate::from_ymd_res(2030, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_oh.rs b/src/data/us_oh.rs new file mode 100644 index 0000000..d076abf --- /dev/null +++ b/src/data/us_oh.rs @@ -0,0 +1,83 @@ +//! United States (Ohio) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Ohio)"; +const COUNTY_CODE: Country = Country::US_OH; + +/// Generate holiday map for United States (Ohio). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_ok.rs b/src/data/us_ok.rs new file mode 100644 index 0000000..9fa4c85 --- /dev/null +++ b/src/data/us_ok.rs @@ -0,0 +1,393 @@ +//! United States (Oklahoma) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Oklahoma)"; +const COUNTY_CODE: Country = Country::US_OK; + +/// Generate holiday map for United States (Oklahoma). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_or.rs b/src/data/us_or.rs new file mode 100644 index 0000000..7114838 --- /dev/null +++ b/src/data/us_or.rs @@ -0,0 +1,83 @@ +//! United States (Oregon) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Oregon)"; +const COUNTY_CODE: Country = Country::US_OR; + +/// Generate holiday map for United States (Oregon). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_pa.rs b/src/data/us_pa.rs new file mode 100644 index 0000000..ad89c86 --- /dev/null +++ b/src/data/us_pa.rs @@ -0,0 +1,393 @@ +//! United States (Pennsylvania) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Pennsylvania)"; +const COUNTY_CODE: Country = Country::US_PA; + +/// Generate holiday map for United States (Pennsylvania). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Day After Thanksgiving", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_pr.rs b/src/data/us_pr.rs new file mode 100644 index 0000000..09e9624 --- /dev/null +++ b/src/data/us_pr.rs @@ -0,0 +1,538 @@ +//! United States (Puerto Rico) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Puerto Rico)"; +const COUNTY_CODE: Country = Country::US_PR; + +/// Generate holiday map for United States (Puerto Rico). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2000, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2000, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2000, 11, 19)?, "Discovery Day"), + ( + NaiveDate::from_ymd_res(2000, 11, 20)?, + "Discovery Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2001, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + (NaiveDate::from_ymd_res(2001, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2001, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2002, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2002, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2002, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2003, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2003, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2003, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2004, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + (NaiveDate::from_ymd_res(2004, 7, 25)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2004, 7, 26)?, + "Constitution Day (observed)", + ), + (NaiveDate::from_ymd_res(2004, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2005, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2005, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2005, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2006, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2006, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2006, 11, 19)?, "Discovery Day"), + ( + NaiveDate::from_ymd_res(2006, 11, 20)?, + "Discovery Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2007, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2007, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2007, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2008, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2008, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2008, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2009, 3, 22)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2009, 3, 23)?, + "Emancipation Day (observed)", + ), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2009, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2009, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2010, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 7, 25)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2010, 7, 26)?, + "Constitution Day (observed)", + ), + (NaiveDate::from_ymd_res(2010, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2011, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + (NaiveDate::from_ymd_res(2011, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2011, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2012, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2012, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2013, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2013, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2013, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2014, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2014, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2015, 3, 22)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2015, 3, 23)?, + "Emancipation Day (observed)", + ), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2015, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2015, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2016, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2016, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2017, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2017, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2017, 11, 19)?, "Discovery Day"), + ( + NaiveDate::from_ymd_res(2017, 11, 20)?, + "Discovery Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2018, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2018, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2019, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2019, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2019, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2020, 3, 22)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2020, 3, 23)?, + "Emancipation Day (observed)", + ), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2020, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2021, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2021, 7, 25)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2021, 7, 26)?, + "Constitution Day (observed)", + ), + (NaiveDate::from_ymd_res(2021, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2022, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2022, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2023, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + (NaiveDate::from_ymd_res(2023, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2023, 11, 19)?, "Discovery Day"), + ( + NaiveDate::from_ymd_res(2023, 11, 20)?, + "Discovery Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2024, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2024, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2025, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2025, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2025, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2026, 3, 22)?, "Emancipation Day"), + ( + NaiveDate::from_ymd_res(2026, 3, 23)?, + "Emancipation Day (observed)", + ), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2026, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2027, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + (NaiveDate::from_ymd_res(2027, 7, 25)?, "Constitution Day"), + ( + NaiveDate::from_ymd_res(2027, 7, 26)?, + "Constitution Day (observed)", + ), + (NaiveDate::from_ymd_res(2027, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2028, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2028, 11, 19)?, "Discovery Day"), + ( + NaiveDate::from_ymd_res(2028, 11, 20)?, + "Discovery Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2029, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2029, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2029, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 6)?, "Epiphany"), + (NaiveDate::from_ymd_res(2030, 3, 22)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 7, 25)?, "Constitution Day"), + (NaiveDate::from_ymd_res(2030, 11, 19)?, "Discovery Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_ri.rs b/src/data/us_ri.rs new file mode 100644 index 0000000..5cbe19f --- /dev/null +++ b/src/data/us_ri.rs @@ -0,0 +1,300 @@ +//! United States (Rhode Island) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Rhode Island)"; +const COUNTY_CODE: Country = Country::US_RI; + +/// Generate holiday map for United States (Rhode Island). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 8, 14)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 8, 13)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 8, 12)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 8, 11)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 8, 9)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 8, 8)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 8, 14)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 8, 13)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 8, 11)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 8, 10)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 8, 9)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 8, 8)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 8, 13)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 8, 12)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 8, 11)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 8, 10)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 8, 8)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 8, 14)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 8, 13)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 8, 12)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 8, 10)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 8, 9)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 8, 8)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 8, 14)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 8, 12)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 8, 11)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 8, 10)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 8, 9)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 8, 14)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 8, 13)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 8, 12)?, "Victory Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_sc.rs b/src/data/us_sc.rs new file mode 100644 index 0000000..2df0388 --- /dev/null +++ b/src/data/us_sc.rs @@ -0,0 +1,393 @@ +//! United States (South Carolina) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (South Carolina)"; +const COUNTY_CODE: Country = Country::US_SC; + +/// Generate holiday map for United States (South Carolina). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [( + NaiveDate::from_ymd_res(2000, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [( + NaiveDate::from_ymd_res(2001, 4, 23)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [( + NaiveDate::from_ymd_res(2002, 4, 22)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [( + NaiveDate::from_ymd_res(2003, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [( + NaiveDate::from_ymd_res(2005, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [( + NaiveDate::from_ymd_res(2006, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [( + NaiveDate::from_ymd_res(2007, 4, 23)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [( + NaiveDate::from_ymd_res(2008, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [( + NaiveDate::from_ymd_res(2009, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [( + NaiveDate::from_ymd_res(2010, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [( + NaiveDate::from_ymd_res(2011, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [( + NaiveDate::from_ymd_res(2012, 4, 23)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [( + NaiveDate::from_ymd_res(2013, 4, 22)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [( + NaiveDate::from_ymd_res(2014, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [( + NaiveDate::from_ymd_res(2015, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [( + NaiveDate::from_ymd_res(2016, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [( + NaiveDate::from_ymd_res(2017, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [( + NaiveDate::from_ymd_res(2018, 4, 23)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [( + NaiveDate::from_ymd_res(2019, 4, 22)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [( + NaiveDate::from_ymd_res(2020, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [( + NaiveDate::from_ymd_res(2022, 4, 25)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [( + NaiveDate::from_ymd_res(2023, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [( + NaiveDate::from_ymd_res(2024, 4, 22)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [( + NaiveDate::from_ymd_res(2025, 4, 28)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [( + NaiveDate::from_ymd_res(2026, 4, 27)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 4, 26)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [( + NaiveDate::from_ymd_res(2028, 4, 24)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [( + NaiveDate::from_ymd_res(2029, 4, 23)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [( + NaiveDate::from_ymd_res(2030, 4, 22)?, + "Confederate Memorial Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_sd.rs b/src/data/us_sd.rs new file mode 100644 index 0000000..fb3d3d5 --- /dev/null +++ b/src/data/us_sd.rs @@ -0,0 +1,83 @@ +//! United States (South Dakota) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (South Dakota)"; +const COUNTY_CODE: Country = Country::US_SD; + +/// Generate holiday map for United States (South Dakota). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_tn.rs b/src/data/us_tn.rs new file mode 100644 index 0000000..bf86a86 --- /dev/null +++ b/src/data/us_tn.rs @@ -0,0 +1,300 @@ +//! United States (Tennessee) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Tennessee)"; +const COUNTY_CODE: Country = Country::US_TN; + +/// Generate holiday map for United States (Tennessee). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [(NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [(NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [(NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_tx.rs b/src/data/us_tx.rs new file mode 100644 index 0000000..176c9cf --- /dev/null +++ b/src/data/us_tx.rs @@ -0,0 +1,1177 @@ +//! United States (Texas) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Texas)"; +const COUNTY_CODE: Country = Country::US_TX; + +/// Generate holiday map for United States (Texas). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + ( + NaiveDate::from_ymd_res(2000, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2000, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2000, 3, 31)?, "Cesar Chavez Day"), + ( + NaiveDate::from_ymd_res(2000, 4, 21)?, + "Good Friday; San Jacinto Day", + ), + ( + NaiveDate::from_ymd_res(2000, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2000, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2000, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2000, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2000, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + ( + NaiveDate::from_ymd_res(2001, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2001, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2001, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + (NaiveDate::from_ymd_res(2001, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2001, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2001, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2001, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2001, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + ( + NaiveDate::from_ymd_res(2002, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2002, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2002, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2002, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2002, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2002, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2002, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2002, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + ( + NaiveDate::from_ymd_res(2003, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2003, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2003, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2003, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2003, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2003, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2003, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2003, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + ( + NaiveDate::from_ymd_res(2004, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2004, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + (NaiveDate::from_ymd_res(2004, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2004, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2004, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Friday After Thanksgiving", + ), + ( + NaiveDate::from_ymd_res(2004, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2004, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + ( + NaiveDate::from_ymd_res(2005, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2005, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2005, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2005, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2005, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2005, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2005, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2005, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + ( + NaiveDate::from_ymd_res(2006, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2006, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2006, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2006, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2006, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2006, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2006, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2006, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2006, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + ( + NaiveDate::from_ymd_res(2007, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2007, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2007, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2007, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2007, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2007, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2007, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2007, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + ( + NaiveDate::from_ymd_res(2008, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2008, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2008, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2008, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2008, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2008, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2008, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2008, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + ( + NaiveDate::from_ymd_res(2009, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2009, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2009, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2009, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2009, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2009, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2009, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + ( + NaiveDate::from_ymd_res(2010, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2010, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2010, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2010, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2010, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Friday After Thanksgiving", + ), + ( + NaiveDate::from_ymd_res(2010, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2010, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + ( + NaiveDate::from_ymd_res(2011, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2011, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2011, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + (NaiveDate::from_ymd_res(2011, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2011, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2011, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2011, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2011, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + ( + NaiveDate::from_ymd_res(2012, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2012, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2012, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2012, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2012, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2012, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2012, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + ( + NaiveDate::from_ymd_res(2013, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2013, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2013, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2013, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2013, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2013, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2013, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2013, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2014, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2014, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2014, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2014, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2014, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2014, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2015, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2015, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2015, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2015, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2015, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2015, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + ( + NaiveDate::from_ymd_res(2016, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2016, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2016, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2016, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2016, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2016, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + ( + NaiveDate::from_ymd_res(2017, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2017, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2017, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2017, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2017, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2017, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2017, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2017, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2017, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + ( + NaiveDate::from_ymd_res(2018, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2018, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2018, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2018, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2018, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2018, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2018, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + ( + NaiveDate::from_ymd_res(2019, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2019, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2019, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2019, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2019, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2019, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2019, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2019, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + ( + NaiveDate::from_ymd_res(2020, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2020, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2020, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2020, 6, 19)?, + "Emancipation Day In Texas", + ), + ( + NaiveDate::from_ymd_res(2020, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2020, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2020, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + ( + NaiveDate::from_ymd_res(2021, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2021, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2021, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2021, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2021, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Friday After Thanksgiving", + ), + ( + NaiveDate::from_ymd_res(2021, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2021, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + ( + NaiveDate::from_ymd_res(2022, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2022, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2022, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2022, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2022, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 23)?, + "Christmas Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2023, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2023, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + (NaiveDate::from_ymd_res(2023, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2023, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2023, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2023, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2024, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2024, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2024, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2024, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2024, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2025, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2025, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2025, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2025, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2025, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2025, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2026, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2026, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2026, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2026, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + ( + NaiveDate::from_ymd_res(2027, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2027, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2027, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + (NaiveDate::from_ymd_res(2027, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2027, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Friday After Thanksgiving", + ), + ( + NaiveDate::from_ymd_res(2027, 12, 23)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2027, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2028, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2028, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2028, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2028, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2028, 12, 22)?, + "Christmas Eve (observed)", + ), + ( + NaiveDate::from_ymd_res(2028, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2029, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2029, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2029, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2029, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2029, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2029, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 1, 19)?, + "Confederate Memorial Day", + ), + ( + NaiveDate::from_ymd_res(2030, 3, 2)?, + "Texas Independence Day", + ), + (NaiveDate::from_ymd_res(2030, 3, 31)?, "Cesar Chavez Day"), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 4, 21)?, "San Jacinto Day"), + ( + NaiveDate::from_ymd_res(2030, 8, 27)?, + "Lyndon Baines Johnson Day", + ), + ( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Friday After Thanksgiving", + ), + (NaiveDate::from_ymd_res(2030, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2030, 12, 26)?, + "Day After Christmas", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_um.rs b/src/data/us_um.rs new file mode 100644 index 0000000..6abadef --- /dev/null +++ b/src/data/us_um.rs @@ -0,0 +1,83 @@ +//! United States (United States Minor Outlying Islands) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (United States Minor Outlying Islands)"; +const COUNTY_CODE: Country = Country::US_UM; + +/// Generate holiday map for United States (United States Minor Outlying Islands). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_ut.rs b/src/data/us_ut.rs new file mode 100644 index 0000000..70781d3 --- /dev/null +++ b/src/data/us_ut.rs @@ -0,0 +1,348 @@ +//! United States (Utah) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Utah)"; +const COUNTY_CODE: Country = Country::US_UT; + +/// Generate holiday map for United States (Utah). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [(NaiveDate::from_ymd_res(2001, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2004, 7, 23)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2005, 7, 25)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [(NaiveDate::from_ymd_res(2009, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2010, 7, 23)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2011, 7, 25)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [(NaiveDate::from_ymd_res(2013, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2016, 7, 25)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [(NaiveDate::from_ymd_res(2017, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2021, 7, 23)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2022, 7, 25)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [(NaiveDate::from_ymd_res(2023, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [(NaiveDate::from_ymd_res(2024, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [(NaiveDate::from_ymd_res(2025, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [(NaiveDate::from_ymd_res(2026, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 7, 24)?, "Pioneer Day"), + ( + NaiveDate::from_ymd_res(2027, 7, 23)?, + "Pioneer Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [(NaiveDate::from_ymd_res(2028, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [(NaiveDate::from_ymd_res(2030, 7, 24)?, "Pioneer Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_va.rs b/src/data/us_va.rs new file mode 100644 index 0000000..7662494 --- /dev/null +++ b/src/data/us_va.rs @@ -0,0 +1,259 @@ +//! United States (Virginia) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Virginia)"; +const COUNTY_CODE: Country = Country::US_VA; + +/// Generate holiday map for United States (Virginia). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [(NaiveDate::from_ymd_res(2000, 1, 14)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 12)?, "Lee Jackson Day"), + (NaiveDate::from_ymd_res(2001, 1, 20)?, "Inauguration Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [(NaiveDate::from_ymd_res(2002, 1, 18)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [(NaiveDate::from_ymd_res(2003, 1, 17)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [(NaiveDate::from_ymd_res(2004, 1, 16)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 14)?, "Lee Jackson Day"), + (NaiveDate::from_ymd_res(2005, 1, 20)?, "Inauguration Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [(NaiveDate::from_ymd_res(2006, 1, 13)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [(NaiveDate::from_ymd_res(2007, 1, 12)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [(NaiveDate::from_ymd_res(2008, 1, 18)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 16)?, "Lee Jackson Day"), + (NaiveDate::from_ymd_res(2009, 1, 20)?, "Inauguration Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [(NaiveDate::from_ymd_res(2010, 1, 15)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [(NaiveDate::from_ymd_res(2011, 1, 14)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [(NaiveDate::from_ymd_res(2012, 1, 13)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 18)?, "Lee Jackson Day"), + (NaiveDate::from_ymd_res(2013, 1, 20)?, "Inauguration Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [(NaiveDate::from_ymd_res(2014, 1, 17)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [(NaiveDate::from_ymd_res(2015, 1, 16)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [(NaiveDate::from_ymd_res(2016, 1, 15)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 13)?, "Lee Jackson Day"), + (NaiveDate::from_ymd_res(2017, 1, 20)?, "Inauguration Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [(NaiveDate::from_ymd_res(2018, 1, 12)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [(NaiveDate::from_ymd_res(2019, 1, 18)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [(NaiveDate::from_ymd_res(2020, 1, 17)?, "Lee Jackson Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [(NaiveDate::from_ymd_res(2021, 1, 20)?, "Inauguration Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2029, + [(NaiveDate::from_ymd_res(2029, 1, 20)?, "Inauguration Day")], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_vi.rs b/src/data/us_vi.rs new file mode 100644 index 0000000..937aec1 --- /dev/null +++ b/src/data/us_vi.rs @@ -0,0 +1,652 @@ +//! United States (Virgin Islands, U.S..) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Virgin Islands, U.S..)"; +const COUNTY_CODE: Country = Country::US_VI; + +/// Generate holiday map for United States (Virgin Islands, U.S..). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2000, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2000, 4, 20)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2000, 4, 24)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2000, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2000, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2000, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2001, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2001, 4, 12)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), + (NaiveDate::from_ymd_res(2001, 4, 16)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2001, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2001, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2001, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2002, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2002, 3, 28)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2002, 4, 1)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2002, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2002, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2002, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2003, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2003, 4, 17)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2003, 4, 21)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2003, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2003, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2003, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2004, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2004, 4, 8)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), + (NaiveDate::from_ymd_res(2004, 4, 12)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2004, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2004, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2004, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2005, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2005, 3, 24)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2005, 3, 28)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2005, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2005, 11, 1)?, "Liberty Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2006, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2006, 4, 13)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2006, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2006, 4, 17)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2006, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2006, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2006, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2007, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2007, 4, 5)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2007, 4, 9)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2007, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2007, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2007, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2008, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2008, 3, 20)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), + (NaiveDate::from_ymd_res(2008, 3, 24)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2008, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2008, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2008, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2009, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2009, 4, 9)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2009, 4, 13)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2009, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2009, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2010, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2010, 4, 1)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2010, 4, 5)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2010, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2010, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2010, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2011, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2011, 4, 21)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), + (NaiveDate::from_ymd_res(2011, 4, 25)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2011, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2011, 11, 1)?, "Liberty Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2012, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2012, 4, 5)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2012, 4, 6)?, "Good Friday"), + (NaiveDate::from_ymd_res(2012, 4, 9)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2012, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2012, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2012, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2013, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2013, 3, 28)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2013, 4, 1)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2013, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2013, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2013, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2014, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2014, 4, 17)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2014, 4, 21)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2014, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2014, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2014, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2015, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2015, 4, 2)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2015, 4, 6)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2015, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2015, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2016, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2016, 3, 24)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), + (NaiveDate::from_ymd_res(2016, 3, 28)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2016, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2016, 11, 1)?, "Liberty Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2017, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2017, 4, 13)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2017, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2017, 4, 17)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2017, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2017, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2017, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2018, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2018, 3, 29)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2018, 4, 2)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2018, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2018, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2018, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2019, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2019, 4, 18)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2019, 4, 22)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2019, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2019, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2019, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2020, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2020, 4, 9)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), + (NaiveDate::from_ymd_res(2020, 4, 13)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2020, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2020, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2021, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2021, 4, 1)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), + (NaiveDate::from_ymd_res(2021, 4, 5)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2021, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2021, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2021, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2022, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2022, 4, 14)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), + (NaiveDate::from_ymd_res(2022, 4, 18)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2022, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2022, 11, 1)?, "Liberty Day"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2023, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2023, 4, 6)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2023, 4, 7)?, "Good Friday"), + (NaiveDate::from_ymd_res(2023, 4, 10)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2023, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2023, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2023, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2024, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2024, 3, 28)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), + (NaiveDate::from_ymd_res(2024, 4, 1)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2024, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2024, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2024, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2025, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2025, 4, 17)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), + (NaiveDate::from_ymd_res(2025, 4, 21)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2025, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2025, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2025, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2026, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2026, 4, 2)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), + (NaiveDate::from_ymd_res(2026, 4, 6)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2026, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2026, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2027, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2027, 3, 25)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), + (NaiveDate::from_ymd_res(2027, 3, 29)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2027, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2027, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2027, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2028, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2028, 4, 13)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), + (NaiveDate::from_ymd_res(2028, 4, 17)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2028, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2028, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2028, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2029, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2029, 3, 29)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), + (NaiveDate::from_ymd_res(2029, 4, 2)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2029, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2029, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2029, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 1, 6)?, "Three Kings Day"), + (NaiveDate::from_ymd_res(2030, 3, 31)?, "Transfer Day"), + (NaiveDate::from_ymd_res(2030, 4, 18)?, "Holy Thursday"), + (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), + (NaiveDate::from_ymd_res(2030, 4, 22)?, "Easter Monday"), + (NaiveDate::from_ymd_res(2030, 7, 3)?, "Emancipation Day"), + (NaiveDate::from_ymd_res(2030, 11, 1)?, "Liberty Day"), + ( + NaiveDate::from_ymd_res(2030, 12, 26)?, + "Christmas Second Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_vt.rs b/src/data/us_vt.rs new file mode 100644 index 0000000..9f01d22 --- /dev/null +++ b/src/data/us_vt.rs @@ -0,0 +1,518 @@ +//! United States (Vermont) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Vermont)"; +const COUNTY_CODE: Country = Country::US_VT; + +/// Generate holiday map for United States (Vermont). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 3, 7)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2000, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 3, 6)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2001, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 3, 5)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2002, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 3, 4)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2003, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2003, 8, 15)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 3, 2)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2004, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 3, 1)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2005, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 3, 7)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2006, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 3, 6)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2007, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 3, 4)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2008, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2008, 8, 15)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 3, 3)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2009, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2009, 8, 17)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 3, 2)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2010, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 3, 1)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2011, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 3, 6)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2012, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 3, 5)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2013, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 3, 4)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2014, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2014, 8, 15)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 3, 3)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2015, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2015, 8, 17)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 3, 1)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2016, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 3, 7)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2017, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 3, 6)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2018, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 3, 5)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2019, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 3, 3)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2020, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2020, 8, 17)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 3, 2)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2021, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 3, 1)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2022, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 3, 7)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2023, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 3, 5)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2024, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 3, 4)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2025, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2025, 8, 15)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 3, 3)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2026, 8, 16)?, + "Bennington Battle Day", + ), + ( + NaiveDate::from_ymd_res(2026, 8, 17)?, + "Bennington Battle Day (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 3, 2)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2027, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 3, 7)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2028, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 3, 6)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2029, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 3, 5)?, "Town Meeting Day"), + ( + NaiveDate::from_ymd_res(2030, 8, 16)?, + "Bennington Battle Day", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_wa.rs b/src/data/us_wa.rs new file mode 100644 index 0000000..94b2e11 --- /dev/null +++ b/src/data/us_wa.rs @@ -0,0 +1,83 @@ +//! United States (Washington) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Washington)"; +const COUNTY_CODE: Country = Country::US_WA; + +/// Generate holiday map for United States (Washington). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/us_wi.rs b/src/data/us_wi.rs new file mode 100644 index 0000000..b24119f --- /dev/null +++ b/src/data/us_wi.rs @@ -0,0 +1,475 @@ +//! United States (Wisconsin) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Wisconsin)"; +const COUNTY_CODE: Country = Country::US_WI; + +/// Generate holiday map for United States (Wisconsin). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [( + NaiveDate::from_ymd_res(2000, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [( + NaiveDate::from_ymd_res(2001, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [( + NaiveDate::from_ymd_res(2002, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [( + NaiveDate::from_ymd_res(2003, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [( + NaiveDate::from_ymd_res(2004, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [( + NaiveDate::from_ymd_res(2005, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [( + NaiveDate::from_ymd_res(2006, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [( + NaiveDate::from_ymd_res(2007, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [( + NaiveDate::from_ymd_res(2008, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [( + NaiveDate::from_ymd_res(2009, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year( + years, + 2011, + [( + NaiveDate::from_ymd_res(2011, 2, 15)?, + "Susan B. Anthony Day", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + ( + NaiveDate::from_ymd_res(2012, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2012, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2012, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + ( + NaiveDate::from_ymd_res(2013, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2013, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2013, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + ( + NaiveDate::from_ymd_res(2014, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2014, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2014, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + ( + NaiveDate::from_ymd_res(2015, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2015, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2015, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 23)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2016, 12, 31)?, "New Year's Eve"), + ( + NaiveDate::from_ymd_res(2016, 12, 30)?, + "New Year's Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + ( + NaiveDate::from_ymd_res(2017, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2017, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2017, 12, 22)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2017, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + ( + NaiveDate::from_ymd_res(2018, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2018, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2018, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + ( + NaiveDate::from_ymd_res(2019, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2019, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2019, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + ( + NaiveDate::from_ymd_res(2020, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2020, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2020, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [( + NaiveDate::from_ymd_res(2021, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + ( + NaiveDate::from_ymd_res(2022, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2022, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 23)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2022, 12, 31)?, "New Year's Eve"), + ( + NaiveDate::from_ymd_res(2022, 12, 30)?, + "New Year's Eve (observed)", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + ( + NaiveDate::from_ymd_res(2023, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2023, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2023, 12, 22)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2023, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + ( + NaiveDate::from_ymd_res(2024, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2024, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2024, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + ( + NaiveDate::from_ymd_res(2025, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2025, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2025, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + ( + NaiveDate::from_ymd_res(2026, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2026, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2026, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [( + NaiveDate::from_ymd_res(2027, 12, 23)?, + "Christmas Eve (observed)", + )], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + ( + NaiveDate::from_ymd_res(2028, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2028, 12, 24)?, "Christmas Eve"), + ( + NaiveDate::from_ymd_res(2028, 12, 22)?, + "Christmas Eve (observed)", + ), + (NaiveDate::from_ymd_res(2028, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + ( + NaiveDate::from_ymd_res(2029, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2029, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2029, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + ( + NaiveDate::from_ymd_res(2030, 2, 15)?, + "Susan B. Anthony Day", + ), + (NaiveDate::from_ymd_res(2030, 12, 24)?, "Christmas Eve"), + (NaiveDate::from_ymd_res(2030, 12, 31)?, "New Year's Eve"), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_wv.rs b/src/data/us_wv.rs new file mode 100644 index 0000000..3578580 --- /dev/null +++ b/src/data/us_wv.rs @@ -0,0 +1,525 @@ +//! United States (West Virginia) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (West Virginia)"; +const COUNTY_CODE: Country = Country::US_WV; + +/// Generate holiday map for United States (West Virginia). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year( + years, + 2000, + [ + (NaiveDate::from_ymd_res(2000, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2000, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2001, + [ + (NaiveDate::from_ymd_res(2001, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2001, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2002, + [ + (NaiveDate::from_ymd_res(2002, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2002, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2003, + [ + (NaiveDate::from_ymd_res(2003, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2003, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2004, + [ + (NaiveDate::from_ymd_res(2004, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2004, 6, 21)?, + "West Virginia Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2004, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2005, + [ + (NaiveDate::from_ymd_res(2005, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2005, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2006, + [ + (NaiveDate::from_ymd_res(2006, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2006, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2007, + [ + (NaiveDate::from_ymd_res(2007, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2007, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2008, + [ + (NaiveDate::from_ymd_res(2008, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2008, 11, 4)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2008, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2009, + [ + (NaiveDate::from_ymd_res(2009, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2009, 6, 19)?, + "West Virginia Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2009, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2010, + [ + (NaiveDate::from_ymd_res(2010, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2010, 6, 21)?, + "West Virginia Day (observed)", + ), + (NaiveDate::from_ymd_res(2010, 11, 2)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2010, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2011, + [ + (NaiveDate::from_ymd_res(2011, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2011, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2012, + [ + (NaiveDate::from_ymd_res(2012, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2012, 11, 6)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2012, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2013, + [ + (NaiveDate::from_ymd_res(2013, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2013, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2014, + [ + (NaiveDate::from_ymd_res(2014, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2014, 11, 4)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2014, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2015, + [ + (NaiveDate::from_ymd_res(2015, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2015, 6, 19)?, + "West Virginia Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2015, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2016, + [ + (NaiveDate::from_ymd_res(2016, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2016, 11, 8)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2016, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2017, + [ + (NaiveDate::from_ymd_res(2017, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2017, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2018, + [ + (NaiveDate::from_ymd_res(2018, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2018, 11, 6)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2018, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2019, + [ + (NaiveDate::from_ymd_res(2019, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2019, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2020, + [ + (NaiveDate::from_ymd_res(2020, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2020, 6, 19)?, + "West Virginia Day (observed)", + ), + (NaiveDate::from_ymd_res(2020, 11, 3)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2020, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2021, + [ + (NaiveDate::from_ymd_res(2021, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2021, 6, 21)?, + "West Virginia Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2021, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2022, + [ + (NaiveDate::from_ymd_res(2022, 11, 8)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2022, 11, 25)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2023, + [ + (NaiveDate::from_ymd_res(2023, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2023, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2024, + [ + (NaiveDate::from_ymd_res(2024, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2024, 11, 5)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2024, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2025, + [ + (NaiveDate::from_ymd_res(2025, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2025, 11, 28)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2026, + [ + (NaiveDate::from_ymd_res(2026, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2026, 11, 3)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2026, 11, 27)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2027, + [ + (NaiveDate::from_ymd_res(2027, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2027, 6, 21)?, + "West Virginia Day (observed)", + ), + ( + NaiveDate::from_ymd_res(2027, 11, 26)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2028, + [ + (NaiveDate::from_ymd_res(2028, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2028, 11, 7)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2028, 11, 24)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2029, + [ + (NaiveDate::from_ymd_res(2029, 6, 20)?, "West Virginia Day"), + ( + NaiveDate::from_ymd_res(2029, 11, 23)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + build_year( + years, + 2030, + [ + (NaiveDate::from_ymd_res(2030, 6, 20)?, "West Virginia Day"), + (NaiveDate::from_ymd_res(2030, 11, 5)?, "Election Day"), + ( + NaiveDate::from_ymd_res(2030, 11, 29)?, + "Day After Thanksgiving", + ), + ], + &mut map, + COUNTY_CODE, + COUNTY_NAME, + ); + + Ok(map) +} diff --git a/src/data/us_wy.rs b/src/data/us_wy.rs new file mode 100644 index 0000000..f8a82ae --- /dev/null +++ b/src/data/us_wy.rs @@ -0,0 +1,83 @@ +//! United States (Wyoming) +#[allow(clippy::wildcard_imports)] +use super::*; + +const COUNTY_NAME: &str = "United States (Wyoming)"; +const COUNTY_CODE: Country = Country::US_WY; + +/// Generate holiday map for United States (Wyoming). +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { + let mut map = HashMap::new(); + + let mut national_holidays = de::build(years)?; + + build_year(years, 2000, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2001, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2002, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2003, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2004, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2005, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2006, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2007, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2008, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2009, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2010, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2011, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2012, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2013, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2014, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2015, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2016, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2017, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2018, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2019, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2020, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2021, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2022, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2023, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2024, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2025, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2026, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2027, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2028, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2029, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + build_year(years, 2030, [], &mut map, COUNTY_CODE, COUNTY_NAME); + + Ok(map) +} diff --git a/src/data/uy.rs b/src/data/uy.rs index e0d1060..bf45dc8 100644 --- a/src/data/uy.rs +++ b/src/data/uy.rs @@ -1,17 +1,24 @@ //! Uruguay +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Uruguay"; +const COUNTY_CODE: Country = Country::UY; + /// Generate holiday map for Uruguay. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2000, 5, 1)?, @@ -32,14 +39,14 @@ pub fn build( ), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2001, 5, 1)?, @@ -56,14 +63,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2002, 5, 1)?, @@ -80,14 +87,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2003, 5, 1)?, @@ -104,14 +111,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2004, 5, 1)?, @@ -128,14 +135,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2005, 5, 1)?, @@ -156,14 +163,14 @@ pub fn build( ), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2006, 5, 1)?, @@ -180,14 +187,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2007, 5, 1)?, @@ -204,14 +211,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2008, 5, 1)?, @@ -228,14 +235,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2009, 5, 1)?, @@ -252,14 +259,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2010, 5, 1)?, @@ -280,14 +287,14 @@ pub fn build( ), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2011, 5, 1)?, @@ -304,14 +311,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2012, 5, 1)?, @@ -328,14 +335,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2013, 5, 1)?, @@ -352,14 +359,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2014, 5, 1)?, @@ -376,14 +383,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2015, 5, 1)?, @@ -404,14 +411,14 @@ pub fn build( ), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2016, 5, 1)?, @@ -428,14 +435,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2017, 5, 1)?, @@ -452,14 +459,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2018, 5, 1)?, @@ -476,14 +483,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2019, 5, 1)?, @@ -500,14 +507,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2020, 5, 1)?, @@ -528,14 +535,14 @@ pub fn build( ), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2021, 5, 1)?, @@ -552,14 +559,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2022, 5, 1)?, @@ -576,14 +583,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2023, 5, 1)?, @@ -600,14 +607,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2024, 5, 1)?, @@ -624,14 +631,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2025, 5, 1)?, @@ -648,14 +655,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2026, 5, 1)?, @@ -672,14 +679,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2027, 5, 1)?, @@ -696,14 +703,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2028, 5, 1)?, @@ -720,14 +727,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2029, 5, 1)?, @@ -744,14 +751,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), ( NaiveDate::from_ymd_res(2030, 5, 1)?, @@ -768,8 +775,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Día de la Familia"), ], &mut map, - Country::UY, - "Uruguay", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/uz.rs b/src/data/uz.rs index 05f707f..222f5a3 100644 --- a/src/data/uz.rs +++ b/src/data/uz.rs @@ -1,17 +1,24 @@ //! Uzbekistan +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Uzbekistan"; +const COUNTY_CODE: Country = Country::UZ; + /// Generate holiday map for Uzbekistan. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2000, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2000, 3, 21)?, "Navro‘z bayrami"), @@ -42,14 +49,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2001, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2001, 3, 21)?, "Navro‘z bayrami"), @@ -76,14 +83,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2002, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2002, 3, 21)?, "Navro‘z bayrami"), @@ -110,14 +117,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2003, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2003, 3, 21)?, "Navro‘z bayrami"), @@ -144,14 +151,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2004, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2004, 3, 21)?, "Navro‘z bayrami"), @@ -178,14 +185,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2005, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2005, 3, 21)?, "Navro‘z bayrami"), @@ -212,14 +219,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2006, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2006, 3, 21)?, "Navro‘z bayrami"), @@ -241,14 +248,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 30)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2007, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2007, 3, 21)?, "Navro‘z bayrami"), @@ -269,14 +276,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 19)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2008, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Navro‘z bayrami"), @@ -295,14 +302,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2009, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2009, 3, 21)?, "Navro‘z bayrami"), @@ -323,14 +330,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 11, 27)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2010, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2010, 3, 21)?, "Navro‘z bayrami"), @@ -351,14 +358,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 11, 16)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2011, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2011, 3, 21)?, "Navro‘z bayrami"), @@ -379,14 +386,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 11, 6)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2012, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2012, 3, 21)?, "Navro‘z bayrami"), @@ -407,14 +414,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 10, 26)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2013, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2013, 3, 21)?, "Navro‘z bayrami"), @@ -435,14 +442,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 10, 15)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2014, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2014, 3, 21)?, "Navro‘z bayrami"), @@ -463,14 +470,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 10, 4)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2015, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2015, 3, 21)?, "Navro‘z bayrami"), @@ -491,14 +498,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 9, 24)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2016, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2016, 3, 21)?, "Navro‘z bayrami"), @@ -519,14 +526,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 9, 12)?, "Qurbon hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2017, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2017, 3, 21)?, "Navro‘z bayrami"), @@ -549,14 +556,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 6, 26)?, "Ro‘za hayit"), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2018, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2018, 3, 21)?, "Navro‘z bayrami"), @@ -621,14 +628,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2019, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2019, 3, 21)?, "Navro‘z bayrami"), @@ -677,14 +684,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2020, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2020, 3, 21)?, "Navro‘z bayrami"), @@ -717,14 +724,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2021, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2021, 3, 21)?, "Navro‘z bayrami"), @@ -773,14 +780,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2022, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2022, 3, 21)?, "Navro‘z bayrami"), @@ -837,14 +844,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2023, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2023, 3, 21)?, "Navro‘z bayrami"), @@ -897,14 +904,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2024, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2024, 3, 21)?, "Navro‘z bayrami"), @@ -972,14 +979,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2025, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2025, 3, 21)?, "Navro‘z bayrami"), @@ -1014,14 +1021,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2026, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2026, 3, 21)?, "Navro‘z bayrami"), @@ -1060,14 +1067,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2027, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2027, 3, 21)?, "Navro‘z bayrami"), @@ -1106,14 +1113,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2028, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2028, 3, 21)?, "Navro‘z bayrami"), @@ -1152,14 +1159,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2029, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2029, 3, 21)?, "Navro‘z bayrami"), @@ -1194,14 +1201,14 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Yangi yil"), (NaiveDate::from_ymd_res(2030, 3, 8)?, "Xotin-qizlar kuni"), (NaiveDate::from_ymd_res(2030, 3, 21)?, "Navro‘z bayrami"), @@ -1240,8 +1247,8 @@ pub fn build( ), ], &mut map, - Country::UZ, - "Uzbekistan", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/ve.rs b/src/data/ve.rs index 56e1347..90fc1e9 100644 --- a/src/data/ve.rs +++ b/src/data/ve.rs @@ -1,17 +1,24 @@ //! Venezuela +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Venezuela"; +const COUNTY_CODE: Country = Country::VE; + /// Generate holiday map for Venezuela. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2000, 3, 6)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2000, 3, 7)?, "Martes de Carnaval"), @@ -43,14 +50,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2001, 2, 26)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2001, 2, 27)?, "Martes de Carnaval"), @@ -82,14 +89,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2002, 2, 11)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2002, 2, 12)?, "Martes de Carnaval"), @@ -124,14 +131,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2003, 3, 3)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2003, 3, 4)?, "Martes de Carnaval"), @@ -166,14 +173,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2004, 2, 23)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2004, 2, 24)?, "Martes de Carnaval"), @@ -208,14 +215,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2005, 2, 7)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2005, 2, 8)?, "Martes de Carnaval"), @@ -250,14 +257,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2006, 2, 27)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2006, 2, 28)?, "Martes de Carnaval"), @@ -292,14 +299,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2007, 2, 19)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2007, 2, 20)?, "Martes de Carnaval"), @@ -334,14 +341,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2008, 2, 4)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2008, 2, 5)?, "Martes de Carnaval"), @@ -376,14 +383,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2009, 2, 23)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2009, 2, 24)?, "Martes de Carnaval"), @@ -418,14 +425,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2010, 2, 15)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2010, 2, 16)?, "Martes de Carnaval"), @@ -460,14 +467,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2011, 3, 7)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2011, 3, 8)?, "Martes de Carnaval"), @@ -502,14 +509,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2012, 2, 20)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2012, 2, 21)?, "Martes de Carnaval"), @@ -544,14 +551,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2013, 2, 11)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2013, 2, 12)?, "Martes de Carnaval"), @@ -586,14 +593,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2014, 3, 3)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2014, 3, 4)?, "Martes de Carnaval"), @@ -628,14 +635,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2015, 2, 16)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2015, 2, 17)?, "Martes de Carnaval"), @@ -670,14 +677,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2016, 2, 8)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2016, 2, 9)?, "Martes de Carnaval"), @@ -712,14 +719,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2017, 2, 27)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2017, 2, 28)?, "Martes de Carnaval"), @@ -754,14 +761,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2018, 2, 12)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2018, 2, 13)?, "Martes de Carnaval"), @@ -796,14 +803,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2019, 3, 4)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2019, 3, 5)?, "Martes de Carnaval"), @@ -837,14 +844,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2020, 2, 24)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2020, 2, 25)?, "Martes de Carnaval"), @@ -879,14 +886,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2021, 2, 15)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2021, 2, 16)?, "Martes de Carnaval"), @@ -921,14 +928,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2022, 2, 28)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2022, 3, 1)?, "Martes de Carnaval"), @@ -963,14 +970,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2023, 2, 20)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2023, 2, 21)?, "Martes de Carnaval"), @@ -1005,14 +1012,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2024, 2, 12)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2024, 2, 13)?, "Martes de Carnaval"), @@ -1047,14 +1054,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2025, 3, 3)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2025, 3, 4)?, "Martes de Carnaval"), @@ -1089,14 +1096,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2026, 2, 16)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2026, 2, 17)?, "Martes de Carnaval"), @@ -1131,14 +1138,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2027, 2, 8)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2027, 2, 9)?, "Martes de Carnaval"), @@ -1173,14 +1180,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2028, 2, 28)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2028, 2, 29)?, "Martes de Carnaval"), @@ -1215,14 +1222,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2029, 2, 12)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2029, 2, 13)?, "Martes de Carnaval"), @@ -1257,14 +1264,14 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "Año Nuevo"), (NaiveDate::from_ymd_res(2030, 3, 4)?, "Lunes de Carnaval"), (NaiveDate::from_ymd_res(2030, 3, 5)?, "Martes de Carnaval"), @@ -1298,8 +1305,8 @@ pub fn build( ), ], &mut map, - Country::VE, - "Venezuela", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/vn.rs b/src/data/vn.rs index 6632bfc..f8911bb 100644 --- a/src/data/vn.rs +++ b/src/data/vn.rs @@ -1,17 +1,24 @@ //! Vietnam +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Vietnam"; +const COUNTY_CODE: Country = Country::VN; + /// Generate holiday map for Vietnam. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ ( NaiveDate::from_ymd_res(2000, 1, 1)?, "International New Year's Day", @@ -60,14 +67,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ ( NaiveDate::from_ymd_res(2001, 1, 1)?, "International New Year's Day", @@ -108,14 +115,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ ( NaiveDate::from_ymd_res(2002, 1, 1)?, "International New Year's Day", @@ -152,14 +159,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ ( NaiveDate::from_ymd_res(2003, 1, 1)?, "International New Year's Day", @@ -196,14 +203,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ ( NaiveDate::from_ymd_res(2004, 1, 1)?, "International New Year's Day", @@ -244,14 +251,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ ( NaiveDate::from_ymd_res(2005, 1, 1)?, "International New Year's Day", @@ -300,14 +307,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ ( NaiveDate::from_ymd_res(2006, 1, 1)?, "International New Year's Day", @@ -356,14 +363,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ ( NaiveDate::from_ymd_res(2007, 1, 1)?, "International New Year's Day", @@ -408,14 +415,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ ( NaiveDate::from_ymd_res(2008, 1, 1)?, "International New Year's Day", @@ -456,14 +463,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ ( NaiveDate::from_ymd_res(2009, 1, 1)?, "International New Year's Day", @@ -508,14 +515,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ ( NaiveDate::from_ymd_res(2010, 1, 1)?, "International New Year's Day", @@ -560,14 +567,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ ( NaiveDate::from_ymd_res(2011, 1, 1)?, "International New Year's Day", @@ -620,14 +627,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ ( NaiveDate::from_ymd_res(2012, 1, 1)?, "International New Year's Day", @@ -680,14 +687,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ ( NaiveDate::from_ymd_res(2013, 1, 1)?, "International New Year's Day", @@ -728,14 +735,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ ( NaiveDate::from_ymd_res(2014, 1, 1)?, "International New Year's Day", @@ -776,14 +783,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ ( NaiveDate::from_ymd_res(2015, 1, 1)?, "International New Year's Day", @@ -824,14 +831,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ ( NaiveDate::from_ymd_res(2016, 1, 1)?, "International New Year's Day", @@ -884,14 +891,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ ( NaiveDate::from_ymd_res(2017, 1, 1)?, "International New Year's Day", @@ -944,14 +951,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ ( NaiveDate::from_ymd_res(2018, 1, 1)?, "International New Year's Day", @@ -996,14 +1003,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ ( NaiveDate::from_ymd_res(2019, 1, 1)?, "International New Year's Day", @@ -1048,14 +1055,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ ( NaiveDate::from_ymd_res(2020, 1, 1)?, "International New Year's Day", @@ -1096,14 +1103,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ ( NaiveDate::from_ymd_res(2021, 1, 1)?, "International New Year's Day", @@ -1148,14 +1155,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ ( NaiveDate::from_ymd_res(2022, 1, 1)?, "International New Year's Day", @@ -1212,14 +1219,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ ( NaiveDate::from_ymd_res(2023, 1, 1)?, "International New Year's Day", @@ -1276,14 +1283,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ ( NaiveDate::from_ymd_res(2024, 1, 1)?, "International New Year's Day", @@ -1324,14 +1331,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ ( NaiveDate::from_ymd_res(2025, 1, 1)?, "International New Year's Day", @@ -1372,14 +1379,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ ( NaiveDate::from_ymd_res(2026, 1, 1)?, "International New Year's Day", @@ -1424,14 +1431,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ ( NaiveDate::from_ymd_res(2027, 1, 1)?, "International New Year's Day", @@ -1476,14 +1483,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ ( NaiveDate::from_ymd_res(2028, 1, 1)?, "International New Year's Day", @@ -1536,14 +1543,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ ( NaiveDate::from_ymd_res(2029, 1, 1)?, "International New Year's Day", @@ -1588,14 +1595,14 @@ pub fn build( ), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ ( NaiveDate::from_ymd_res(2030, 1, 1)?, "International New Year's Day", @@ -1636,8 +1643,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 9, 2)?, "Independence Day"), ], &mut map, - Country::VN, - "Vietnam", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/za.rs b/src/data/za.rs index 5fbc940..ee8f364 100644 --- a/src/data/za.rs +++ b/src/data/za.rs @@ -1,17 +1,24 @@ //! South Africa +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "South Africa"; +const COUNTY_CODE: Country = Country::ZA; + /// Generate holiday map for South Africa. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 4, 24)?, "Family Day"), @@ -38,14 +45,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 4, 16)?, "Family Day"), @@ -67,14 +74,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 4, 1)?, "Family Day"), @@ -96,14 +103,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2003, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2003, 4, 21)?, "Family Day"), @@ -125,14 +132,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 4, 12)?, "Family Day"), @@ -162,14 +169,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 3, 28)?, "Family Day"), @@ -191,14 +198,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -228,14 +235,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 4, 9)?, "Family Day"), @@ -257,14 +264,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2008, 3, 21)?, @@ -292,14 +299,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 4, 13)?, "Family Day"), @@ -325,14 +332,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 4, 5)?, "Family Day"), @@ -358,14 +365,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), (NaiveDate::from_ymd_res(2011, 4, 25)?, "Family Day"), @@ -395,14 +402,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -428,14 +435,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 4, 1)?, "Family Day"), @@ -457,14 +464,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2014, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2014, 4, 21)?, "Family Day"), @@ -490,14 +497,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 4, 6)?, "Family Day"), @@ -519,14 +526,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 3, 28)?, "Family Day"), @@ -556,14 +563,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -589,14 +596,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2018, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2018, 4, 2)?, "Family Day"), @@ -618,14 +625,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2019, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2019, 4, 22)?, "Family Day"), @@ -651,14 +658,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2020, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2020, 4, 13)?, "Family Day"), @@ -680,14 +687,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2021, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2021, 4, 5)?, "Family Day"), @@ -714,14 +721,14 @@ pub fn build( (NaiveDate::from_ymd_res(2021, 11, 1)?, "Municipal elections"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2022, 4, 15)?, "Good Friday"), (NaiveDate::from_ymd_res(2022, 4, 18)?, "Family Day"), @@ -747,14 +754,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -784,14 +791,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2024, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2024, 4, 1)?, "Family Day"), @@ -817,14 +824,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2025, 4, 18)?, "Good Friday"), (NaiveDate::from_ymd_res(2025, 4, 21)?, "Family Day"), @@ -846,14 +853,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2026, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2026, 4, 6)?, "Family Day"), @@ -875,14 +882,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2027, 3, 26)?, "Good Friday"), (NaiveDate::from_ymd_res(2027, 3, 29)?, "Family Day"), @@ -908,14 +915,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2028, 4, 14)?, "Good Friday"), (NaiveDate::from_ymd_res(2028, 4, 17)?, "Family Day"), @@ -937,14 +944,14 @@ pub fn build( ), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2029, 3, 30)?, "Good Friday"), (NaiveDate::from_ymd_res(2029, 4, 2)?, "Family Day"), @@ -966,14 +973,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2030, 4, 19)?, "Good Friday"), (NaiveDate::from_ymd_res(2030, 4, 22)?, "Family Day"), @@ -995,8 +1002,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 9, 24)?, "Heritage Day"), ], &mut map, - Country::ZA, - "South Africa", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/zm.rs b/src/data/zm.rs index b001245..d84f463 100644 --- a/src/data/zm.rs +++ b/src/data/zm.rs @@ -1,17 +1,24 @@ //! Zambia +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Zambia"; +const COUNTY_CODE: Country = Country::ZM; + /// Generate holiday map for Zambia. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2000, 3, 8)?, @@ -34,14 +41,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2001, 3, 8)?, @@ -60,14 +67,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2002, 3, 8)?, @@ -86,14 +93,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2003, 3, 8)?, @@ -116,14 +123,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2004, 3, 8)?, @@ -146,14 +153,14 @@ pub fn build( (NaiveDate::from_ymd_res(2004, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2005, 3, 8)?, @@ -180,14 +187,14 @@ pub fn build( ), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -214,14 +221,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2007, 3, 8)?, @@ -240,14 +247,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2008, 3, 8)?, @@ -270,14 +277,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2009, 3, 8)?, @@ -300,14 +307,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2010, 3, 8)?, @@ -330,14 +337,14 @@ pub fn build( (NaiveDate::from_ymd_res(2010, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2011, 3, 8)?, @@ -364,14 +371,14 @@ pub fn build( ), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -394,14 +401,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2013, 3, 8)?, @@ -420,14 +427,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2014, 3, 8)?, @@ -450,14 +457,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2015, 3, 8)?, @@ -488,14 +495,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2016, 3, 8)?, @@ -534,14 +541,14 @@ pub fn build( ), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -572,14 +579,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2018, 3, 8)?, @@ -607,14 +614,14 @@ pub fn build( ), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2019, 3, 8)?, @@ -637,14 +644,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2020, 3, 8)?, @@ -675,14 +682,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2021, 3, 8)?, @@ -726,14 +733,14 @@ pub fn build( ), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2022, 3, 8)?, @@ -769,14 +776,14 @@ pub fn build( ), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -808,14 +815,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2024, 3, 8)?, @@ -843,14 +850,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2025, 3, 8)?, @@ -878,14 +885,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2026, 3, 8)?, @@ -917,14 +924,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2027, 3, 8)?, @@ -952,14 +959,14 @@ pub fn build( (NaiveDate::from_ymd_res(2027, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 3, 8)?, @@ -987,14 +994,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2029, 3, 8)?, @@ -1018,14 +1025,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2030, 3, 8)?, @@ -1053,8 +1060,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 25)?, "Christmas Day"), ], &mut map, - Country::ZM, - "Zambia", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/data/zw.rs b/src/data/zw.rs index d3ee811..579a2d1 100644 --- a/src/data/zw.rs +++ b/src/data/zw.rs @@ -1,17 +1,24 @@ //! Zimbabwe +#[allow(clippy::wildcard_imports)] use super::*; +const COUNTY_NAME: &str = "Zimbabwe"; +const COUNTY_CODE: Country = Country::ZW; + /// Generate holiday map for Zimbabwe. -#[allow(unused_mut, unused_variables)] -pub fn build( - years: &Option<&std::ops::Range>, -) -> Result>> { +#[allow( + unused_mut, + unused_variables, + clippy::too_many_lines, + clippy::missing_errors_doc +)] +pub fn build(years: Option<&std::ops::Range>) -> Result { let mut map = HashMap::new(); build_year( years, 2000, - vec![ + [ (NaiveDate::from_ymd_res(2000, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2000, 4, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2000, 4, 22)?, "Easter Saturday"), @@ -29,14 +36,14 @@ pub fn build( (NaiveDate::from_ymd_res(2000, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2001, - vec![ + [ (NaiveDate::from_ymd_res(2001, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2001, 4, 13)?, "Good Friday"), (NaiveDate::from_ymd_res(2001, 4, 14)?, "Easter Saturday"), @@ -54,14 +61,14 @@ pub fn build( (NaiveDate::from_ymd_res(2001, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2002, - vec![ + [ (NaiveDate::from_ymd_res(2002, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2002, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2002, 3, 30)?, "Easter Saturday"), @@ -83,14 +90,14 @@ pub fn build( (NaiveDate::from_ymd_res(2002, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2003, - vec![ + [ (NaiveDate::from_ymd_res(2003, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2003, 4, 18)?, @@ -114,14 +121,14 @@ pub fn build( (NaiveDate::from_ymd_res(2003, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2004, - vec![ + [ (NaiveDate::from_ymd_res(2004, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2004, 4, 9)?, "Good Friday"), (NaiveDate::from_ymd_res(2004, 4, 10)?, "Easter Saturday"), @@ -144,14 +151,14 @@ pub fn build( ), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2005, - vec![ + [ (NaiveDate::from_ymd_res(2005, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2005, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2005, 3, 26)?, "Easter Saturday"), @@ -174,14 +181,14 @@ pub fn build( (NaiveDate::from_ymd_res(2005, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2006, - vec![ + [ (NaiveDate::from_ymd_res(2006, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2006, 1, 2)?, @@ -203,14 +210,14 @@ pub fn build( (NaiveDate::from_ymd_res(2006, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2007, - vec![ + [ (NaiveDate::from_ymd_res(2007, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2007, 4, 6)?, "Good Friday"), (NaiveDate::from_ymd_res(2007, 4, 7)?, "Easter Saturday"), @@ -228,14 +235,14 @@ pub fn build( (NaiveDate::from_ymd_res(2007, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2008, - vec![ + [ (NaiveDate::from_ymd_res(2008, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2008, 3, 21)?, "Good Friday"), (NaiveDate::from_ymd_res(2008, 3, 22)?, "Easter Saturday"), @@ -257,14 +264,14 @@ pub fn build( (NaiveDate::from_ymd_res(2008, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2009, - vec![ + [ (NaiveDate::from_ymd_res(2009, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2009, 4, 10)?, "Good Friday"), (NaiveDate::from_ymd_res(2009, 4, 11)?, "Easter Saturday"), @@ -282,14 +289,14 @@ pub fn build( (NaiveDate::from_ymd_res(2009, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2010, - vec![ + [ (NaiveDate::from_ymd_res(2010, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2010, 4, 2)?, "Good Friday"), (NaiveDate::from_ymd_res(2010, 4, 3)?, "Easter Saturday"), @@ -312,14 +319,14 @@ pub fn build( ), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2011, - vec![ + [ (NaiveDate::from_ymd_res(2011, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2011, 4, 22)?, "Good Friday"), (NaiveDate::from_ymd_res(2011, 4, 23)?, "Easter Saturday"), @@ -342,14 +349,14 @@ pub fn build( (NaiveDate::from_ymd_res(2011, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2012, - vec![ + [ (NaiveDate::from_ymd_res(2012, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2012, 1, 2)?, @@ -371,14 +378,14 @@ pub fn build( (NaiveDate::from_ymd_res(2012, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2013, - vec![ + [ (NaiveDate::from_ymd_res(2013, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2013, 3, 29)?, "Good Friday"), (NaiveDate::from_ymd_res(2013, 3, 30)?, "Easter Saturday"), @@ -400,14 +407,14 @@ pub fn build( (NaiveDate::from_ymd_res(2013, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2014, - vec![ + [ (NaiveDate::from_ymd_res(2014, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2014, 4, 18)?, @@ -431,14 +438,14 @@ pub fn build( (NaiveDate::from_ymd_res(2014, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2015, - vec![ + [ (NaiveDate::from_ymd_res(2015, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2015, 4, 3)?, "Good Friday"), (NaiveDate::from_ymd_res(2015, 4, 4)?, "Easter Saturday"), @@ -456,14 +463,14 @@ pub fn build( (NaiveDate::from_ymd_res(2015, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2016, - vec![ + [ (NaiveDate::from_ymd_res(2016, 1, 1)?, "New Year's Day"), (NaiveDate::from_ymd_res(2016, 3, 25)?, "Good Friday"), (NaiveDate::from_ymd_res(2016, 3, 26)?, "Easter Saturday"), @@ -486,14 +493,14 @@ pub fn build( (NaiveDate::from_ymd_res(2016, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2017, - vec![ + [ (NaiveDate::from_ymd_res(2017, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2017, 1, 2)?, @@ -515,14 +522,14 @@ pub fn build( (NaiveDate::from_ymd_res(2017, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2018, - vec![ + [ (NaiveDate::from_ymd_res(2018, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2018, 2, 21)?, @@ -544,14 +551,14 @@ pub fn build( (NaiveDate::from_ymd_res(2018, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2019, - vec![ + [ (NaiveDate::from_ymd_res(2019, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2019, 2, 21)?, @@ -577,14 +584,14 @@ pub fn build( (NaiveDate::from_ymd_res(2019, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2020, - vec![ + [ (NaiveDate::from_ymd_res(2020, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2020, 2, 21)?, @@ -606,14 +613,14 @@ pub fn build( (NaiveDate::from_ymd_res(2020, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2021, - vec![ + [ (NaiveDate::from_ymd_res(2021, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2021, 2, 21)?, @@ -644,14 +651,14 @@ pub fn build( ), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2022, - vec![ + [ (NaiveDate::from_ymd_res(2022, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2022, 2, 21)?, @@ -680,14 +687,14 @@ pub fn build( (NaiveDate::from_ymd_res(2022, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2023, - vec![ + [ (NaiveDate::from_ymd_res(2023, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2023, 1, 2)?, @@ -713,14 +720,14 @@ pub fn build( (NaiveDate::from_ymd_res(2023, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2024, - vec![ + [ (NaiveDate::from_ymd_res(2024, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2024, 2, 21)?, @@ -746,14 +753,14 @@ pub fn build( (NaiveDate::from_ymd_res(2024, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2025, - vec![ + [ (NaiveDate::from_ymd_res(2025, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2025, 2, 21)?, @@ -781,14 +788,14 @@ pub fn build( (NaiveDate::from_ymd_res(2025, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2026, - vec![ + [ (NaiveDate::from_ymd_res(2026, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2026, 2, 21)?, @@ -810,14 +817,14 @@ pub fn build( (NaiveDate::from_ymd_res(2026, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2027, - vec![ + [ (NaiveDate::from_ymd_res(2027, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2027, 2, 21)?, @@ -848,14 +855,14 @@ pub fn build( ), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2028, - vec![ + [ (NaiveDate::from_ymd_res(2028, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2028, 2, 21)?, @@ -877,14 +884,14 @@ pub fn build( (NaiveDate::from_ymd_res(2028, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2029, - vec![ + [ (NaiveDate::from_ymd_res(2029, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2029, 2, 21)?, @@ -906,14 +913,14 @@ pub fn build( (NaiveDate::from_ymd_res(2029, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); build_year( years, 2030, - vec![ + [ (NaiveDate::from_ymd_res(2030, 1, 1)?, "New Year's Day"), ( NaiveDate::from_ymd_res(2030, 2, 21)?, @@ -939,8 +946,8 @@ pub fn build( (NaiveDate::from_ymd_res(2030, 12, 26)?, "Boxing Day"), ], &mut map, - Country::ZW, - "Zimbabwe", + COUNTY_CODE, + COUNTY_NAME, ); Ok(map) diff --git a/src/iter.rs b/src/iter.rs index 2ac1023..dcb5b00 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -1,7 +1,7 @@ use chrono::{Datelike, NaiveDate}; use once_cell::sync::Lazy; -use crate::{prelude::*, Error, Holiday, Result, DATA}; +use crate::{get_map_for_country_and_year, prelude::*, Error, Holiday, Result, DATA}; use std::collections::VecDeque; #[derive(Debug)] @@ -30,29 +30,40 @@ impl std::iter::Iterator for Iter { } /// Iterate holidays by dates. -#[allow(dead_code)] +#[allow(dead_code, clippy::missing_errors_doc)] pub fn iter(country: Country, since: NaiveDate, until: NaiveDate) -> Result { - let Some(data) = Lazy::get(&DATA) else { - return Err(Error::Uninitialized); - }; + let data = Lazy::get(&DATA).ok_or(Error::Uninitialized)?; - let mut buf = VecDeque::new(); + let mut buf = Vec::new(); - let mut y = since.year(); - while y <= until.year() { + for y in since.year()..=until.year() { let data = data.read().map_err(|e| Error::LockError(e.to_string()))?; - let Some(map) = data.get(&country) else { - return Err(Error::CountryNotAvailable); - }; - let Some(map) = map.get(&y) else { - break; + let country_map = match get_map_for_country_and_year(&data, country, y) { + Err(Error::CountryNotAvailable) => return Err(Error::CountryNotAvailable), + Err(_) => break, + Ok(map) => map, }; - buf.extend(map.values().cloned()); - - y += 1; + buf.extend( + country_map + .country + .values() + .chain( + country_map + .subdivision + .map(|s| s.values()) + .unwrap_or_default(), + ) + .cloned(), + ); } - Ok(Iter { since, until, buf }) + buf.sort_by_key(|h| h.date); + + Ok(Iter { + since, + until, + buf: buf.into_iter().collect(), + }) } diff --git a/src/lib.rs b/src/lib.rs index 4eaeb3e..c1f583b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,12 +11,13 @@ use chrono::{Datelike, NaiveDate}; use once_cell::sync::Lazy; use std::{ collections::{BTreeMap, HashMap}, - sync::RwLock, + sync::{RwLock, RwLockReadGuard}, }; /// Type alias for Holiday map. -pub type HolidayPerCountryMap = HashMap>; -pub type HolidayMap = HashMap; +pub type HolidayPerDayMap = BTreeMap; +pub type HolidayPerYearMap = HashMap; +pub type HolidayMap = HashMap; /// Type alias for Year. pub type Year = i32; @@ -30,6 +31,7 @@ static DATA: Lazy> = Lazy::new(|| RwLock::new(HolidayMap::new /// Note that this will use quite lots of memory. Please consider using /// `Builder` to specify countries and years to load for if you're concerned /// about memory usage. +#[allow(clippy::missing_errors_doc)] pub fn init() -> Result<()> { let map = Builder::new().build()?; init_holiday(map) @@ -38,41 +40,65 @@ pub fn init() -> Result<()> { /// Get holiday by ISO 3166-1 alpha-2 country code and date. If the specified country or year is /// not available, it will return `Err(Error)`. If the specified date is not a holiday, it /// will return `Ok(None)`. Otherwise, it will return `Ok(Some(Holiday))`. +#[allow(clippy::missing_errors_doc)] pub fn get(country: Country, date: NaiveDate) -> Result> { - let Some(data) = Lazy::get(&DATA) else { - return Err(Error::Uninitialized); - }; + let holiday_map = get_holiday_map()?; - let data = data.read().map_err(|e| Error::LockError(e.to_string()))?; - let Some(map) = data.get(&country) else { - return Err(Error::CountryNotAvailable); - }; + let map = get_map_for_country_and_year(&holiday_map, country, date.year())?; - let Some(map) = map.get(&date.year()) else { - return Err(Error::YearNotAvailable); - }; - - Ok(map.get(&date).cloned()) + Ok(map.get(date).cloned()) } /// Check if the specified date is a holiday. If the specified country or year is /// not available, it will return `Err(Error)`. If the date is not a holiday, it /// will return `Ok(false)`. Otherwise, it will return `Ok(true)`. +#[allow(clippy::missing_errors_doc)] pub fn contains(country: Country, date: NaiveDate) -> Result { - let Some(data) = Lazy::get(&DATA) else { - return Err(Error::Uninitialized); - }; + let holiday_map = get_holiday_map()?; + + let map = get_map_for_country_and_year(&holiday_map, country, date.year())?; - let data = data.read().map_err(|e| Error::LockError(e.to_string()))?; - let Some(map) = data.get(&country) else { - return Err(Error::CountryNotAvailable); - }; + Ok(map.get(date).is_some()) +} + +fn get_holiday_map() -> Result> { + let data = Lazy::get(&DATA).ok_or(Error::Uninitialized)?; + data.read().map_err(|e| Error::LockError(e.to_string())) +} - let Some(map) = map.get(&date.year()) else { - return Err(Error::YearNotAvailable); - }; +struct CountryWithSubdivision<'a> { + country: &'a HolidayPerDayMap, + subdivision: Option<&'a HolidayPerDayMap>, +} + +impl<'a> CountryWithSubdivision<'a> { + pub fn get(&self, date: NaiveDate) -> Option<&Holiday> { + self.country + .get(&date) + .or_else(|| self.subdivision.and_then(|s| s.get(&date))) + } +} - Ok(map.get(&date).is_some()) +fn get_map_for_country_and_year<'a>( + holiday_map: &'a RwLockReadGuard<'a, HolidayMap>, + country: Country, + year: Year, +) -> Result> { + let (country, subdivision) = Country::country_from_subdivision(country) + .map_or_else(|| (country, None), |c| (c, Some(country))); + + let map = holiday_map + .get(&country) + .ok_or(Error::CountryNotAvailable)?; + + let map = map.get(&year).ok_or(Error::YearNotAvailable)?; + + Ok(CountryWithSubdivision { + country: map, + subdivision: subdivision + .and_then(|subdiv| holiday_map.get(&subdiv)) + .and_then(|m| m.get(&year)), + }) } /// Represents a holiday. @@ -94,8 +120,8 @@ impl Holiday { country: impl Into, date: NaiveDate, name: impl Into, - ) -> Holiday { - Holiday { + ) -> Self { + Self { code, country: country.into(), date, @@ -116,11 +142,11 @@ pub enum Error { /// Holiday database is not initialized yet. #[error("Holiday database is not initialized yet")] Uninitialized, - /// Failed to get RwLock. + /// Failed to get `RwLock`. #[error("Failed to get RwLock: {0}")] LockError(String), - /// Unexpexted error occurred. - #[error("Unexpexted error occurred: {0}")] + /// Unexpected error occurred. + #[error("Unexpected error occurred: {0}")] Unexpected(String), } diff --git a/tests/test.rs b/tests/test.rs index 8f0fd2b..18a2566 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -38,6 +38,25 @@ fn build_by_country() -> anyhow::Result<()> { Ok(()) } +#[test] +#[serial] +fn build_by_subdivision() -> anyhow::Result<()> { + Builder::new() + .countries(&[Country::DE_NW]) + .years(2024..2025) + .init()?; + + let d = NaiveDate::from_ymd_res(2024, 5, 1)?; + assert_eq!("Erster Mai", get(Country::DE, d)?.unwrap().name); + assert_eq!("Erster Mai", get(Country::DE_NW, d)?.unwrap().name); + + let d = NaiveDate::from_ymd_res(2024, 5, 30)?; + assert!(get(Country::DE, d)?.is_none()); + assert_eq!("Fronleichnam", get(Country::DE_NW, d)?.unwrap().name); + + Ok(()) +} + #[test] #[serial] fn build_by_year() -> anyhow::Result<()> { @@ -127,3 +146,28 @@ fn iterate_year_not_available() -> anyhow::Result<()> { Ok(()) } + +#[test] +#[serial] +fn iterate_subdivision() -> anyhow::Result<()> { + Builder::new() + .countries(&[Country::DE, Country::DE_NW]) + .years(2024..2025) + .init()?; + + let s = NaiveDate::from_ymd_res(2024, 5, 1)?; + let u = NaiveDate::from_ymd_res(2024, 5, 31)?; + assert_eq!( + vec![ + NaiveDate::from_ymd_res(2024, 5, 1)?, + NaiveDate::from_ymd_res(2024, 5, 9)?, + NaiveDate::from_ymd_res(2024, 5, 20)?, + NaiveDate::from_ymd_res(2024, 5, 30)?, + ], + iter(Country::DE_NW, s, u)? + .map(|h| h.date) + .collect::>() + ); + + Ok(()) +}