Skip to main content

celes/
lib.rs

1/*
2    Copyright Michael Lodder. All Rights Reserved.
3    SPDX-License-Identifier: Apache-2.0 OR MIT
4*/
5//! Rust implementation of Countries as specified by
6//! [Country Codes](https://www.iban.com/country-codes)
7//! and [ISO-3166-1](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
8//!
9//! If there are any countries missing then please let me know or submit a PR
10//!
11//! The main struct is `Country` which provides the following properties
12//!
13//! `code` - The three digit code for the country
14//! `value` - The code as an integer
15//! `alpha2` - The alpha2 letter set for the country
16//! `alpha3` - The alpha3 letter set for the country
17//! `long_name` - The official state name for the country
18//! `aliases` - Other names by which the country is known. For example,
19//! The Russian Federation is also called Russia or The United Kingdom of Great Britain
20//! and Northern Ireland is also called England, Great Britain,
21//! Northern Ireland, Scotland, and United Kingdom.
22//!
23//! Each country can be instantiated by using a function with the country name in snake case
24//!
25//! ## Usage
26//!
27//! ```
28//! use celes::Country;
29//!
30//!
31//!  let gb = Country::the_united_kingdom_of_great_britain_and_northern_ireland();
32//!  println!("{}", gb);
33//!
34//!  let usa = Country::the_united_states_of_america();
35//!  println!("{}", usa);
36//!
37//! ```
38//!
39//! Additionally, each country can be created from a string or its numeric code.
40//! `Country` provides multiple from methods to instantiate it from a string:
41//!
42//! - `from_code` - create `Country` from three digit code
43//! - `from_value` - create `Country` from the numeric code as an integer
44//! - `from_alpha2` - create `Country` from two letter code
45//! - `from_alpha3` - create `Country` from three letter code
46//! - `from_alias` - create `Country` from a common alias stripped of any spaces or
47//!   underscores. This only works for some countries as not all countries have aliases
48//! - `from_name` - create `Country` from the full state name no space or underscores
49//!
50//! `Country` implements the [core::str::FromStr](https://doc.rust-lang.org/core/str/trait.FromStr.html) trait that accepts any valid argument to the previously mentioned functions
51//! such as:
52//!
53//! - The country aliases like UnitedKingdom, GreatBritain, Russia, America
54//! - The full country name
55//! - The numeric code (e.g. "840")
56//! - The alpha2 code
57//! - The alpha3 code
58//!
59//! If you are uncertain which function to use, just use `Country::from_str` as it accepts
60//! any of the valid string values. `Country::from_str` is case-insensitive
61//!
62//! ## From String Example
63//!
64//! ```rust
65//! use celes::Country;
66//! use core::str::FromStr;
67//!
68//! // All of these are equivalent
69//! assert_eq!("US", Country::from_str("USA").unwrap().alpha2);
70//! assert_eq!("US", Country::from_str("US").unwrap().alpha2);
71//! assert_eq!("US", Country::from_str("America").unwrap().alpha2);
72//! assert_eq!("US", Country::from_str("UnitedStates").unwrap().alpha2);
73//! assert_eq!("US", Country::from_str("TheUnitedStatesOfAmerica").unwrap().alpha2);
74//!
75//! // All of these are equivalent
76//! assert_eq!("GB", Country::from_str("England").unwrap().alpha2);
77//! assert_eq!("GB", Country::from_str("gb").unwrap().alpha2);
78//! assert_eq!("GB", Country::from_str("Scotland").unwrap().alpha2);
79//! assert_eq!("GB", Country::from_str("TheUnitedKingdomOfGreatBritainAndNorthernIreland").unwrap().alpha2);
80//! ```
81
82mod tables;
83
84use core::{
85    cmp::Ordering,
86    fmt::{Debug, Display, Formatter, Result as FmtResult, Write},
87    hash::{Hash, Hasher},
88    str::FromStr,
89};
90use phf::{Map, phf_map};
91use serde::{
92    Deserialize, Deserializer, Serialize, Serializer,
93    de::{Error as DError, Visitor},
94};
95pub use tables::*;
96
97/// Perform a PHF map lookup with ASCII-lowercased input, avoiding heap allocation.
98/// Falls back to `str::to_lowercase` for non-ASCII input (e.g. "Türkiye").
99fn lookup_ascii_lowercase<'a, V>(map: &'a Map<&'static str, V>, key: &str) -> Option<&'a V> {
100    // Stack buffer large enough for the longest key in any map
101    // ("theunitedkingdomofgreatbritainandnorthernireland" = 48 chars)
102    let mut buf = [0u8; 64];
103    if key.len() <= buf.len() && key.is_ascii() {
104        let buf = &mut buf[..key.len()];
105        buf.copy_from_slice(key.as_bytes());
106        buf.make_ascii_lowercase();
107        // SAFETY: input was ASCII, ASCII lowercase is still valid UTF-8
108        let lowered = unsafe { core::str::from_utf8_unchecked(buf) };
109        map.get(lowered)
110    } else {
111        map.get(key.to_lowercase().as_str())
112    }
113}
114
115/// Creates the country function. Meant to be called inside `Country`
116macro_rules! country {
117    ($func:ident, $code:expr, $value:expr, $alpha2:expr, $alpha3:expr, $long_name:expr) => {
118        country!{ @gen [concat!("Creates a struct for ", $long_name), $func, $code, $value, $alpha2, $alpha3, $long_name] }
119    };
120    ($func:ident, $code:expr, $value:expr, $alpha2:expr, $alpha3:expr, $long_name:expr, $table:ident, $( $alias:expr  ),*) => {
121        country!{ @gen [concat!("Creates a struct for ", $long_name), $func, $code, $value, $alpha2, $alpha3, $long_name, $table, $( $alias ),* ] }
122    };
123    (@gen [$doc:expr, $func:ident, $code:expr, $value:expr, $alpha2:expr, $alpha3:expr, $long_name:expr]) => {
124        #[doc = $doc]
125        #[inline]
126        pub const fn $func() -> Self {
127            Self {
128                code: $code,
129                value: $value,
130                alpha2: $alpha2,
131                alpha3: $alpha3,
132                long_name: $long_name,
133                aliases: EMPTY_LOOKUP_TABLE.into_country_table(),
134            }
135        }
136    };
137    (@gen [$doc:expr, $func:ident, $code:expr, $value:expr, $alpha2:expr, $alpha3:expr, $long_name:expr, $table:ident, $( $alias:expr ),* ]) => {
138        #[doc = $doc]
139        #[inline]
140        pub const fn $func() -> Self {
141            Self {
142                code: $code,
143                value: $value,
144                alpha2: $alpha2,
145                alpha3: $alpha3,
146                long_name: $long_name,
147                aliases: $table::const_default().into_country_table()
148            }
149        }
150    };
151}
152
153/// Represents a country according to ISO 3166
154#[derive(Copy, Clone)]
155pub struct Country {
156    /// The three digit code assigned to the country
157    pub code: &'static str,
158    /// The integer value for `code`
159    pub value: usize,
160    /// The two letter country code (alpha-2) assigned to the country
161    pub alpha2: &'static str,
162    /// The three letter country code (alpha-3) assigned to the country
163    pub alpha3: &'static str,
164    /// The official state name of the country
165    pub long_name: &'static str,
166    /// Common aliases associated with the country
167    pub aliases: CountryTable,
168}
169
170impl Debug for Country {
171    fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
172        write!(
173            f,
174            "Country {{ code: {}, value: {}, alpha2: {}, alpha3: {}, long_name: {}, aliases: {} }}",
175            self.code, self.value, self.alpha2, self.alpha3, self.long_name, self.aliases
176        )
177    }
178}
179
180impl Display for Country {
181    fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
182        for c in self.long_name.chars() {
183            if c != ' ' {
184                f.write_char(c)?;
185            }
186        }
187        Ok(())
188    }
189}
190
191impl Ord for Country {
192    fn cmp(&self, other: &Self) -> Ordering {
193        self.long_name.cmp(other.long_name)
194    }
195}
196
197impl PartialOrd for Country {
198    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
199        Some(self.cmp(other))
200    }
201}
202
203impl Eq for Country {}
204
205impl PartialEq for Country {
206    fn eq(&self, other: &Self) -> bool {
207        self.value == other.value
208    }
209}
210
211impl Serialize for Country {
212    fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
213    where
214        S: Serializer,
215    {
216        s.serialize_str(self.alpha2)
217    }
218}
219
220impl<'de> Deserialize<'de> for Country {
221    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
222    where
223        D: Deserializer<'de>,
224    {
225        struct CountryVisitor;
226        impl Visitor<'_> for CountryVisitor {
227            type Value = Country;
228
229            fn expecting(&self, f: &mut Formatter<'_>) -> FmtResult {
230                write!(f, "a two letter string")
231            }
232
233            fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
234            where
235                E: DError,
236            {
237                Country::from_alpha2(s)
238                    .map_err(|_| DError::invalid_value(serde::de::Unexpected::Str(s), &self))
239            }
240        }
241
242        deserializer.deserialize_str(CountryVisitor)
243    }
244}
245
246impl Hash for Country {
247    fn hash<H: Hasher>(&self, state: &mut H) {
248        self.value.hash(state);
249    }
250}
251
252impl Country {
253    country!(afghanistan, "004", 4, "AF", "AFG", "Afghanistan");
254
255    country!(aland_islands, "248", 248, "AX", "ALA", "Aland Islands");
256
257    country!(albania, "008", 8, "AL", "ALB", "Albania");
258
259    country!(algeria, "012", 12, "DZ", "DZA", "Algeria");
260
261    country!(
262        american_samoa,
263        "016",
264        16,
265        "AS",
266        "ASM",
267        "American Samoa",
268        SamoaTable,
269        "Samoa"
270    );
271
272    country!(andorra, "020", 20, "AD", "AND", "Andorra");
273
274    country!(angola, "024", 24, "AO", "AGO", "Angola");
275
276    country!(anguilla, "660", 660, "AI", "AIA", "Anguilla");
277
278    country!(antarctica, "010", 10, "AQ", "ATA", "Antarctica");
279
280    country!(
281        antigua_and_barbuda,
282        "028",
283        28,
284        "AG",
285        "ATG",
286        "Antigua And Barbuda"
287    );
288
289    country!(argentina, "032", 32, "AR", "ARG", "Argentina");
290
291    country!(armenia, "051", 51, "AM", "ARM", "Armenia");
292
293    country!(aruba, "533", 533, "AW", "ABW", "Aruba");
294
295    country!(
296        ascension_and_tristan_da_cunha_saint_helena,
297        "654",
298        654,
299        "SH",
300        "SHN",
301        "Ascension And Tristan Da Cunha Saint Helena",
302        SaintHelenaTable,
303        "StHelena",
304        "SaintHelena"
305    );
306
307    country!(australia, "036", 36, "AU", "AUS", "Australia");
308
309    country!(austria, "040", 40, "AT", "AUT", "Austria");
310
311    country!(azerbaijan, "031", 31, "AZ", "AZE", "Azerbaijan");
312
313    country!(bahrain, "048", 48, "BH", "BHR", "Bahrain");
314
315    country!(bangladesh, "050", 50, "BD", "BGD", "Bangladesh");
316
317    country!(barbados, "052", 52, "BB", "BRB", "Barbados");
318
319    country!(belarus, "112", 112, "BY", "BLR", "Belarus");
320
321    country!(belgium, "056", 56, "BE", "BEL", "Belgium");
322
323    country!(belize, "084", 84, "BZ", "BLZ", "Belize");
324
325    country!(benin, "204", 204, "BJ", "BEN", "Benin");
326
327    country!(bermuda, "060", 60, "BM", "BMU", "Bermuda");
328
329    country!(bhutan, "064", 64, "BT", "BTN", "Bhutan");
330
331    country!(
332        bolivarian_republic_of_venezuela,
333        "862",
334        862,
335        "VE",
336        "VEN",
337        "Bolivarian Republic Of Venezuela",
338        VenezuelaTable,
339        "Venezuela"
340    );
341
342    country!(bolivia, "068", 68, "BO", "BOL", "Bolivia");
343
344    country!(bonaire, "535", 535, "BQ", "BES", "Bonaire");
345
346    country!(
347        bosnia_and_herzegovina,
348        "070",
349        70,
350        "BA",
351        "BIH",
352        "Bosnia And Herzegovina",
353        BosniaTable,
354        "Bosnia",
355        "Herzegovina"
356    );
357
358    country!(botswana, "072", 72, "BW", "BWA", "Botswana");
359
360    country!(bouvet_island, "074", 74, "BV", "BVT", "Bouvet Island");
361
362    country!(brazil, "076", 76, "BR", "BRA", "Brazil");
363
364    country!(
365        british_indian_ocean_territory,
366        "086",
367        86,
368        "IO",
369        "IOT",
370        "British Indian Ocean Territory"
371    );
372
373    country!(
374        british_virgin_islands,
375        "092",
376        92,
377        "VG",
378        "VGB",
379        "British Virgin Islands"
380    );
381
382    country!(
383        brunei_darussalam,
384        "096",
385        96,
386        "BN",
387        "BRN",
388        "Brunei Darussalam",
389        BruneiTable,
390        "Brunei"
391    );
392
393    country!(bulgaria, "100", 100, "BG", "BGR", "Bulgaria");
394
395    country!(
396        burkina_faso,
397        "854",
398        854,
399        "BF",
400        "BFA",
401        "Burkina Faso",
402        BurkinaTable,
403        "Burkina"
404    );
405
406    country!(burundi, "108", 108, "BI", "BDI", "Burundi");
407
408    country!(cabo_verde, "132", 132, "CV", "CPV", "Cabo Verde");
409
410    country!(cambodia, "116", 116, "KH", "KHM", "Cambodia");
411
412    country!(cameroon, "120", 120, "CM", "CMR", "Cameroon");
413
414    country!(canada, "124", 124, "CA", "CAN", "Canada");
415
416    country!(chad, "148", 148, "TD", "TCD", "Chad");
417
418    country!(chile, "152", 152, "CL", "CHL", "Chile");
419
420    country!(china, "156", 156, "CN", "CHN", "China");
421
422    country!(
423        christmas_island,
424        "162",
425        162,
426        "CX",
427        "CXR",
428        "Christmas Island"
429    );
430
431    country!(colombia, "170", 170, "CO", "COL", "Colombia");
432
433    country!(costa_rica, "188", 188, "CR", "CRI", "Costa Rica");
434
435    country!(coted_ivoire, "384", 384, "CI", "CIV", "Coted Ivoire");
436
437    country!(croatia, "191", 191, "HR", "HRV", "Croatia");
438
439    country!(cuba, "192", 192, "CU", "CUB", "Cuba");
440
441    country!(curacao, "531", 531, "CW", "CUW", "Curacao");
442
443    country!(cyprus, "196", 196, "CY", "CYP", "Cyprus");
444
445    country!(
446        czechia,
447        "203",
448        203,
449        "CZ",
450        "CZE",
451        "Czechia",
452        CzechiaTable,
453        "CzechRepublic"
454    );
455
456    country!(denmark, "208", 208, "DK", "DNK", "Denmark");
457
458    country!(djibouti, "262", 262, "DJ", "DJI", "Djibouti");
459
460    country!(dominica, "212", 212, "DM", "DMA", "Dominica");
461
462    country!(
463        dutch_part_sint_maarten,
464        "534",
465        534,
466        "SX",
467        "SXM",
468        "Dutch Part Sint Maarten",
469        StMaartenTable,
470        "StMaarten",
471        "SaintMaarten"
472    );
473
474    country!(ecuador, "218", 218, "EC", "ECU", "Ecuador");
475
476    country!(egypt, "818", 818, "EG", "EGY", "Egypt");
477
478    country!(el_salvador, "222", 222, "SV", "SLV", "El Salvador");
479
480    country!(
481        equatorial_guinea,
482        "226",
483        226,
484        "GQ",
485        "GNQ",
486        "Equatorial Guinea"
487    );
488
489    country!(eritrea, "232", 232, "ER", "ERI", "Eritrea");
490
491    country!(estonia, "233", 233, "EE", "EST", "Estonia");
492
493    country!(eswatini, "748", 748, "SZ", "SWZ", "Eswatini");
494
495    country!(ethiopia, "231", 231, "ET", "ETH", "Ethiopia");
496
497    country!(
498        federated_states_of_micronesia,
499        "583",
500        583,
501        "FM",
502        "FSM",
503        "Federated States Of Micronesia",
504        MicronesiaTable,
505        "Micronesia"
506    );
507
508    country!(fiji, "242", 242, "FJ", "FJI", "Fiji");
509
510    country!(finland, "246", 246, "FI", "FIN", "Finland");
511
512    country!(france, "250", 250, "FR", "FRA", "France");
513
514    country!(french_guiana, "254", 254, "GF", "GUF", "French Guiana");
515
516    country!(
517        french_part_saint_martin,
518        "663",
519        663,
520        "MF",
521        "MAF",
522        "French Part Saint Martin",
523        StMartinTable,
524        "StMartin",
525        "SaintMartin"
526    );
527
528    country!(
529        french_polynesia,
530        "258",
531        258,
532        "PF",
533        "PYF",
534        "French Polynesia"
535    );
536
537    country!(gabon, "266", 266, "GA", "GAB", "Gabon");
538
539    country!(georgia, "268", 268, "GE", "GEO", "Georgia");
540
541    country!(germany, "276", 276, "DE", "DEU", "Germany");
542
543    country!(ghana, "288", 288, "GH", "GHA", "Ghana");
544
545    country!(gibraltar, "292", 292, "GI", "GIB", "Gibraltar");
546
547    country!(greece, "300", 300, "GR", "GRC", "Greece");
548
549    country!(greenland, "304", 304, "GL", "GRL", "Greenland");
550
551    country!(grenada, "308", 308, "GD", "GRD", "Grenada");
552
553    country!(guadeloupe, "312", 312, "GP", "GLP", "Guadeloupe");
554
555    country!(guam, "316", 316, "GU", "GUM", "Guam");
556
557    country!(guatemala, "320", 320, "GT", "GTM", "Guatemala");
558
559    country!(guernsey, "831", 831, "GG", "GGY", "Guernsey");
560
561    country!(guinea, "324", 324, "GN", "GIN", "Guinea");
562
563    country!(guinea_bissau, "624", 624, "GW", "GNB", "Guinea Bissau");
564
565    country!(guyana, "328", 328, "GY", "GUY", "Guyana");
566
567    country!(haiti, "332", 332, "HT", "HTI", "Haiti");
568
569    country!(
570        heard_island_and_mc_donald_islands,
571        "334",
572        334,
573        "HM",
574        "HMD",
575        "Heard Island And Mc Donald Islands",
576        HeardIslandTable,
577        "HeardIsland",
578        "McDonaldIslands"
579    );
580
581    country!(honduras, "340", 340, "HN", "HND", "Honduras");
582
583    country!(hong_kong, "344", 344, "HK", "HKG", "Hong Kong");
584
585    country!(hungary, "348", 348, "HU", "HUN", "Hungary");
586
587    country!(iceland, "352", 352, "IS", "ISL", "Iceland");
588
589    country!(india, "356", 356, "IN", "IND", "India");
590
591    country!(indonesia, "360", 360, "ID", "IDN", "Indonesia");
592
593    country!(iraq, "368", 368, "IQ", "IRQ", "Iraq");
594
595    country!(ireland, "372", 372, "IE", "IRL", "Ireland");
596
597    country!(
598        islamic_republic_of_iran,
599        "364",
600        364,
601        "IR",
602        "IRN",
603        "Islamic Republic Of Iran",
604        IranTable,
605        "Iran"
606    );
607
608    country!(isle_of_man, "833", 833, "IM", "IMN", "Isle Of Man");
609
610    country!(israel, "376", 376, "IL", "ISR", "Israel");
611
612    country!(italy, "380", 380, "IT", "ITA", "Italy");
613
614    country!(jamaica, "388", 388, "JM", "JAM", "Jamaica");
615
616    country!(japan, "392", 392, "JP", "JPN", "Japan");
617
618    country!(jersey, "832", 832, "JE", "JEY", "Jersey");
619
620    country!(jordan, "400", 400, "JO", "JOR", "Jordan");
621
622    country!(kazakhstan, "398", 398, "KZ", "KAZ", "Kazakhstan");
623
624    country!(kenya, "404", 404, "KE", "KEN", "Kenya");
625
626    country!(kiribati, "296", 296, "KI", "KIR", "Kiribati");
627
628    country!(kosovo, "383", 383, "XK", "XKX", "Kosovo");
629
630    country!(kuwait, "414", 414, "KW", "KWT", "Kuwait");
631
632    country!(kyrgyzstan, "417", 417, "KG", "KGZ", "Kyrgyzstan");
633
634    country!(latvia, "428", 428, "LV", "LVA", "Latvia");
635
636    country!(lebanon, "422", 422, "LB", "LBN", "Lebanon");
637
638    country!(lesotho, "426", 426, "LS", "LSO", "Lesotho");
639
640    country!(liberia, "430", 430, "LR", "LBR", "Liberia");
641
642    country!(libya, "434", 434, "LY", "LBY", "Libya");
643
644    country!(liechtenstein, "438", 438, "LI", "LIE", "Liechtenstein");
645
646    country!(lithuania, "440", 440, "LT", "LTU", "Lithuania");
647
648    country!(luxembourg, "442", 442, "LU", "LUX", "Luxembourg");
649
650    country!(macao, "446", 446, "MO", "MAC", "Macao");
651
652    country!(madagascar, "450", 450, "MG", "MDG", "Madagascar");
653
654    country!(malawi, "454", 454, "MW", "MWI", "Malawi");
655
656    country!(malaysia, "458", 458, "MY", "MYS", "Malaysia");
657
658    country!(maldives, "462", 462, "MV", "MDV", "Maldives");
659
660    country!(mali, "466", 466, "ML", "MLI", "Mali");
661
662    country!(malta, "470", 470, "MT", "MLT", "Malta");
663
664    country!(martinique, "474", 474, "MQ", "MTQ", "Martinique");
665
666    country!(mauritania, "478", 478, "MR", "MRT", "Mauritania");
667
668    country!(mauritius, "480", 480, "MU", "MUS", "Mauritius");
669
670    country!(mayotte, "175", 175, "YT", "MYT", "Mayotte");
671
672    country!(mexico, "484", 484, "MX", "MEX", "Mexico");
673
674    country!(monaco, "492", 492, "MC", "MCO", "Monaco");
675
676    country!(mongolia, "496", 496, "MN", "MNG", "Mongolia");
677
678    country!(montenegro, "499", 499, "ME", "MNE", "Montenegro");
679
680    country!(montserrat, "500", 500, "MS", "MSR", "Montserrat");
681
682    country!(morocco, "504", 504, "MA", "MAR", "Morocco");
683
684    country!(mozambique, "508", 508, "MZ", "MOZ", "Mozambique");
685
686    country!(myanmar, "104", 104, "MM", "MMR", "Myanmar");
687
688    country!(namibia, "516", 516, "NA", "NAM", "Namibia");
689
690    country!(nauru, "520", 520, "NR", "NRU", "Nauru");
691
692    country!(nepal, "524", 524, "NP", "NPL", "Nepal");
693
694    country!(new_caledonia, "540", 540, "NC", "NCL", "New Caledonia");
695
696    country!(new_zealand, "554", 554, "NZ", "NZL", "New Zealand");
697
698    country!(nicaragua, "558", 558, "NI", "NIC", "Nicaragua");
699
700    country!(nigeria, "566", 566, "NG", "NGA", "Nigeria");
701
702    country!(niue, "570", 570, "NU", "NIU", "Niue");
703
704    country!(norfolk_island, "574", 574, "NF", "NFK", "Norfolk Island");
705
706    country!(norway, "578", 578, "NO", "NOR", "Norway");
707
708    country!(oman, "512", 512, "OM", "OMN", "Oman");
709
710    country!(pakistan, "586", 586, "PK", "PAK", "Pakistan");
711
712    country!(palau, "585", 585, "PW", "PLW", "Palau");
713
714    country!(panama, "591", 591, "PA", "PAN", "Panama");
715
716    country!(
717        papua_new_guinea,
718        "598",
719        598,
720        "PG",
721        "PNG",
722        "Papua New Guinea"
723    );
724
725    country!(paraguay, "600", 600, "PY", "PRY", "Paraguay");
726
727    country!(peru, "604", 604, "PE", "PER", "Peru");
728
729    country!(pitcairn, "612", 612, "PN", "PCN", "Pitcairn");
730
731    country!(poland, "616", 616, "PL", "POL", "Poland");
732
733    country!(portugal, "620", 620, "PT", "PRT", "Portugal");
734
735    country!(puerto_rico, "630", 630, "PR", "PRI", "Puerto Rico");
736
737    country!(qatar, "634", 634, "QA", "QAT", "Qatar");
738
739    country!(
740        republic_of_north_macedonia,
741        "807",
742        807,
743        "MK",
744        "MKD",
745        "Republic Of North Macedonia",
746        MacedoniaTable,
747        "Macedonia"
748    );
749
750    country!(reunion, "638", 638, "RE", "REU", "Reunion");
751
752    country!(romania, "642", 642, "RO", "ROU", "Romania");
753
754    country!(rwanda, "646", 646, "RW", "RWA", "Rwanda");
755
756    country!(
757        saint_barthelemy,
758        "652",
759        652,
760        "BL",
761        "BLM",
762        "Saint Barthelemy",
763        StBarthelemyTable,
764        "StBarthelemy"
765    );
766
767    country!(
768        saint_kitts_and_nevis,
769        "659",
770        659,
771        "KN",
772        "KNA",
773        "Saint Kitts And Nevis",
774        StKittsTable,
775        "StKitts"
776    );
777
778    country!(
779        saint_lucia,
780        "662",
781        662,
782        "LC",
783        "LCA",
784        "Saint Lucia",
785        StLuciaTable,
786        "StLucia"
787    );
788
789    country!(
790        saint_pierre_and_miquelon,
791        "666",
792        666,
793        "PM",
794        "SPM",
795        "Saint Pierre And Miquelon",
796        StPierreTable,
797        "StPierre",
798        "SaintPierre"
799    );
800
801    country!(
802        saint_vincent_and_the_grenadines,
803        "670",
804        670,
805        "VC",
806        "VCT",
807        "Saint Vincent And The Grenadines",
808        StVincentTable,
809        "StVincent",
810        "SaintVincent"
811    );
812
813    country!(samoa, "882", 882, "WS", "WSM", "Samoa");
814
815    country!(san_marino, "674", 674, "SM", "SMR", "San Marino");
816
817    country!(
818        sao_tome_and_principe,
819        "678",
820        678,
821        "ST",
822        "STP",
823        "Sao Tome And Principe",
824        SaoTomeTable,
825        "SaoTome"
826    );
827
828    country!(saudi_arabia, "682", 682, "SA", "SAU", "Saudi Arabia");
829
830    country!(senegal, "686", 686, "SN", "SEN", "Senegal");
831
832    country!(serbia, "688", 688, "RS", "SRB", "Serbia");
833
834    country!(seychelles, "690", 690, "SC", "SYC", "Seychelles");
835
836    country!(sierra_leone, "694", 694, "SL", "SLE", "Sierra Leone");
837
838    country!(singapore, "702", 702, "SG", "SGP", "Singapore");
839
840    country!(slovakia, "703", 703, "SK", "SVK", "Slovakia");
841
842    country!(slovenia, "705", 705, "SI", "SVN", "Slovenia");
843
844    country!(solomon_islands, "090", 90, "SB", "SLB", "Solomon Islands");
845
846    country!(somalia, "706", 706, "SO", "SOM", "Somalia");
847
848    country!(south_africa, "710", 710, "ZA", "ZAF", "South Africa");
849
850    country!(
851        south_georgia_and_the_south_sandwich_islands,
852        "239",
853        239,
854        "GS",
855        "SGS",
856        "South Georgia And The South Sandwich Islands",
857        SouthGeorgiaTable,
858        "SouthGeorgia",
859        "SouthSandwichIslands"
860    );
861
862    country!(south_sudan, "728", 728, "SS", "SSD", "South Sudan");
863
864    country!(spain, "724", 724, "ES", "ESP", "Spain");
865
866    country!(sri_lanka, "144", 144, "LK", "LKA", "Sri Lanka");
867
868    country!(
869        state_of_palestine,
870        "275",
871        275,
872        "PS",
873        "PSE",
874        "State Of Palestine",
875        PalestineTable,
876        "Palestine"
877    );
878
879    country!(suriname, "740", 740, "SR", "SUR", "Suriname");
880
881    country!(
882        svalbard_and_jan_mayen,
883        "744",
884        744,
885        "SJ",
886        "SJM",
887        "Svalbard And Jan Mayen"
888    );
889
890    country!(sweden, "752", 752, "SE", "SWE", "Sweden");
891
892    country!(switzerland, "756", 756, "CH", "CHE", "Switzerland");
893
894    country!(
895        syrian_arab_republic,
896        "760",
897        760,
898        "SY",
899        "SYR",
900        "Syrian Arab Republic"
901    );
902
903    country!(
904        taiwan,
905        "158",
906        158,
907        "TW",
908        "TWN",
909        "Taiwan, Republic Of China",
910        TaiwanTable,
911        "Taiwan",
912        "台灣",
913        "Republic of China",
914        "中華民國"
915    );
916
917    country!(tajikistan, "762", 762, "TJ", "TJK", "Tajikistan");
918
919    country!(thailand, "764", 764, "TH", "THA", "Thailand");
920
921    country!(
922        the_bahamas,
923        "044",
924        44,
925        "BS",
926        "BHS",
927        "The Bahamas",
928        BahamasTable,
929        "Bahamas"
930    );
931
932    country!(
933        the_cayman_islands,
934        "136",
935        136,
936        "KY",
937        "CYM",
938        "The Cayman Islands",
939        CaymanIslandsTable,
940        "CaymanIslands"
941    );
942
943    country!(
944        the_central_african_republic,
945        "140",
946        140,
947        "CF",
948        "CAF",
949        "The Central African Republic",
950        CentralAfricanRepublicTable,
951        "CentralAfricanRepublic"
952    );
953
954    country!(
955        the_cocos_keeling_islands,
956        "166",
957        166,
958        "CC",
959        "CCK",
960        "The Cocos Keeling Islands",
961        CocosIslandsTable,
962        "CocosIslands",
963        "KeelingIslands"
964    );
965
966    country!(
967        the_comoros,
968        "174",
969        174,
970        "KM",
971        "COM",
972        "The Comoros",
973        ComorosTable,
974        "Comoros"
975    );
976
977    country!(
978        the_congo,
979        "178",
980        178,
981        "CG",
982        "COG",
983        "The Congo",
984        CongoTable,
985        "Congo"
986    );
987
988    country!(
989        the_cook_islands,
990        "184",
991        184,
992        "CK",
993        "COK",
994        "The Cook Islands",
995        CookIslandsTable,
996        "CookIslands"
997    );
998
999    country!(
1000        the_democratic_peoples_republic_of_korea,
1001        "408",
1002        408,
1003        "KP",
1004        "PRK",
1005        "The Democratic Peoples Republic Of Korea",
1006        NorthKoreaTable,
1007        "NorthKorea",
1008        "DemocraticPeoplesRepublicOfKorea"
1009    );
1010
1011    country!(
1012        the_democratic_republic_of_the_congo,
1013        "180",
1014        180,
1015        "CD",
1016        "COD",
1017        "The Democratic Republic Of The Congo",
1018        DemocraticRepublicOfTheCongoTable,
1019        "DemocraticRepublicOfTheCongo"
1020    );
1021
1022    country!(
1023        the_dominican_republic,
1024        "214",
1025        214,
1026        "DO",
1027        "DOM",
1028        "The Dominican Republic",
1029        DominicanRepublicTable,
1030        "DominicanRepublic"
1031    );
1032
1033    country!(
1034        the_falkland_islands_malvinas,
1035        "238",
1036        238,
1037        "FK",
1038        "FLK",
1039        "The Falkland Islands Malvinas",
1040        MalvinasTable,
1041        "Malvinas",
1042        "FalklandIslands"
1043    );
1044
1045    country!(
1046        the_faroe_islands,
1047        "234",
1048        234,
1049        "FO",
1050        "FRO",
1051        "The Faroe Islands",
1052        FaroeIslandsTable,
1053        "FaroeIslands"
1054    );
1055
1056    country!(
1057        the_french_southern_territories,
1058        "260",
1059        260,
1060        "TF",
1061        "ATF",
1062        "The French Southern Territories",
1063        FrenchSouthernTerritoriesTable,
1064        "FrenchSouthernTerritories"
1065    );
1066
1067    country!(
1068        the_gambia,
1069        "270",
1070        270,
1071        "GM",
1072        "GMB",
1073        "The Gambia",
1074        GambiaTable,
1075        "Gabmia"
1076    );
1077
1078    country!(
1079        the_holy_see,
1080        "336",
1081        336,
1082        "VA",
1083        "VAT",
1084        "The Holy See",
1085        HolySeeTable,
1086        "HolySee"
1087    );
1088
1089    country!(
1090        the_lao_peoples_democratic_republic,
1091        "418",
1092        418,
1093        "LA",
1094        "LAO",
1095        "The Lao Peoples Democratic Republic",
1096        LaoPeoplesDemocraticRepublicTable,
1097        "LaoPeoplesDemocraticRepublic"
1098    );
1099
1100    country!(
1101        the_marshall_islands,
1102        "584",
1103        584,
1104        "MH",
1105        "MHL",
1106        "The Marshall Islands",
1107        MarshallIslandsTable,
1108        "MarshallIslands"
1109    );
1110
1111    country!(
1112        the_netherlands,
1113        "528",
1114        528,
1115        "NL",
1116        "NLD",
1117        "The Netherlands",
1118        NetherlandsTable,
1119        "Netherlands",
1120        "Holland"
1121    );
1122
1123    country!(
1124        the_niger,
1125        "562",
1126        562,
1127        "NE",
1128        "NER",
1129        "The Niger",
1130        NigerTable,
1131        "Niger"
1132    );
1133
1134    country!(
1135        the_northern_mariana_islands,
1136        "580",
1137        580,
1138        "MP",
1139        "MNP",
1140        "The Northern Mariana Islands",
1141        NorthernMarianaIslandsTable,
1142        "NorthernMarianaIslands"
1143    );
1144
1145    country!(
1146        the_philippines,
1147        "608",
1148        608,
1149        "PH",
1150        "PHL",
1151        "The Philippines",
1152        PhilippinesTable,
1153        "Philippines"
1154    );
1155
1156    country!(
1157        the_republic_of_korea,
1158        "410",
1159        410,
1160        "KR",
1161        "KOR",
1162        "The Republic Of Korea",
1163        SouthKoreaTable,
1164        "SouthKorea",
1165        "RepublicOfKorea"
1166    );
1167
1168    country!(
1169        the_republic_of_moldova,
1170        "498",
1171        498,
1172        "MD",
1173        "MDA",
1174        "The Republic Of Moldova",
1175        MoldovaTable,
1176        "Moldova",
1177        "RepublicOfMoldova"
1178    );
1179
1180    country!(
1181        the_russian_federation,
1182        "643",
1183        643,
1184        "RU",
1185        "RUS",
1186        "The Russian Federation",
1187        RussiaTable,
1188        "Russia",
1189        "RussianFederation"
1190    );
1191
1192    country!(
1193        the_sudan,
1194        "729",
1195        729,
1196        "SD",
1197        "SDN",
1198        "The Sudan",
1199        SudanTable,
1200        "Sudan"
1201    );
1202
1203    country!(
1204        the_turks_and_caicos_islands,
1205        "796",
1206        796,
1207        "TC",
1208        "TCA",
1209        "The Turks And Caicos Islands",
1210        TurksAndCaicosIslandsTable,
1211        "TurksAndCaicosIslands"
1212    );
1213
1214    country!(
1215        the_united_arab_emirates,
1216        "784",
1217        784,
1218        "AE",
1219        "ARE",
1220        "The United Arab Emirates",
1221        UnitedArabEmiratesTable,
1222        "UnitedArabEmirates"
1223    );
1224
1225    country!(
1226        the_united_kingdom_of_great_britain_and_northern_ireland,
1227        "826",
1228        826,
1229        "GB",
1230        "GBR",
1231        "The United Kingdom Of Great Britain And Northern Ireland",
1232        EnglandTable,
1233        "England",
1234        "Scotland",
1235        "GreatBritain",
1236        "UnitedKingdom",
1237        "NorthernIreland",
1238        "UnitedKingdomOfGreatBritain",
1239        "UnitedKingdomOfGreatBritainAndNorthernIreland"
1240    );
1241
1242    country!(
1243        the_united_states_minor_outlying_islands,
1244        "581",
1245        581,
1246        "UM",
1247        "UMI",
1248        "The United States Minor Outlying Islands",
1249        UnitedStatesMinorOutlyingIslandsTable,
1250        "UnitedStatesMinorOutlyingIslands"
1251    );
1252
1253    country!(
1254        the_united_states_of_america,
1255        "840",
1256        840,
1257        "US",
1258        "USA",
1259        "The United States Of America",
1260        AmericaTable,
1261        "America",
1262        "UnitedStates",
1263        "UnitedStatesOfAmerica"
1264    );
1265
1266    country!(
1267        timor_leste,
1268        "626",
1269        626,
1270        "TL",
1271        "TLS",
1272        "Timor Leste",
1273        TimorTable,
1274        "EastTimor"
1275    );
1276
1277    country!(togo, "768", 768, "TG", "TGO", "Togo");
1278
1279    country!(tokelau, "772", 772, "TK", "TKL", "Tokelau");
1280
1281    country!(tonga, "776", 776, "TO", "TON", "Tonga");
1282
1283    country!(
1284        trinidad_and_tobago,
1285        "780",
1286        780,
1287        "TT",
1288        "TTO",
1289        "Trinidad And Tobago",
1290        TrinidadTable,
1291        "Trinidad",
1292        "Tobago"
1293    );
1294
1295    country!(tunisia, "788", 788, "TN", "TUN", "Tunisia");
1296
1297    country!(
1298        turkey,
1299        "792",
1300        792,
1301        "TR",
1302        "TUR",
1303        "Türkiye",
1304        TurkeyTable,
1305        "Turkey"
1306    );
1307
1308    country!(turkmenistan, "795", 795, "TM", "TKM", "Turkmenistan");
1309
1310    country!(tuvalu, "798", 798, "TV", "TUV", "Tuvalu");
1311
1312    country!(
1313        us_virgin_islands,
1314        "850",
1315        850,
1316        "VI",
1317        "VIR",
1318        "US Virgin Islands"
1319    );
1320
1321    country!(uganda, "800", 800, "UG", "UGA", "Uganda");
1322
1323    country!(ukraine, "804", 804, "UA", "UKR", "Ukraine");
1324
1325    country!(
1326        united_republic_of_tanzania,
1327        "834",
1328        834,
1329        "TZ",
1330        "TZA",
1331        "United Republic Of Tanzania",
1332        TanzaniaTable,
1333        "Tanzania"
1334    );
1335
1336    country!(uruguay, "858", 858, "UY", "URY", "Uruguay");
1337
1338    country!(uzbekistan, "860", 860, "UZ", "UZB", "Uzbekistan");
1339
1340    country!(vanuatu, "548", 548, "VU", "VUT", "Vanuatu");
1341
1342    country!(vietnam, "704", 704, "VN", "VNM", "Vietnam");
1343
1344    country!(
1345        wallis_and_futuna,
1346        "876",
1347        876,
1348        "WF",
1349        "WLF",
1350        "Wallis And Futuna"
1351    );
1352
1353    country!(western_sahara, "732", 732, "EH", "ESH", "Western Sahara");
1354
1355    country!(yemen, "887", 887, "YE", "YEM", "Yemen");
1356
1357    country!(zambia, "894", 894, "ZM", "ZMB", "Zambia");
1358
1359    country!(zimbabwe, "716", 716, "ZW", "ZWE", "Zimbabwe");
1360
1361    /// Returns a vector in alphabetic order of all the countries
1362    ///
1363    /// ```
1364    /// use celes::Country;
1365    /// use std::collections::BTreeMap;
1366    ///
1367    /// let countries = Country::get_countries();
1368    ///
1369    ///
1370    /// for c in &countries {
1371    ///     println!("{}", c);
1372    /// }
1373    ///
1374    /// for c in &countries {
1375    ///     println!("{}", c.alpha2);
1376    /// }
1377    ///
1378    /// for c in countries.iter().filter(|cty| cty.value < 300) {
1379    ///     println!("{}", c.long_name)
1380    /// }
1381    ///
1382    /// //Convert to a map
1383    /// let lookup = countries.iter().map(|cty| (cty.alpha2.to_string(), cty.clone())).collect::<BTreeMap<String, Country>>();
1384    ///
1385    /// ```
1386    pub const fn get_countries() -> [Self; 250] {
1387        [
1388            Self::afghanistan(),
1389            Self::aland_islands(),
1390            Self::albania(),
1391            Self::algeria(),
1392            Self::american_samoa(),
1393            Self::andorra(),
1394            Self::angola(),
1395            Self::anguilla(),
1396            Self::antarctica(),
1397            Self::antigua_and_barbuda(),
1398            Self::argentina(),
1399            Self::armenia(),
1400            Self::aruba(),
1401            Self::ascension_and_tristan_da_cunha_saint_helena(),
1402            Self::australia(),
1403            Self::austria(),
1404            Self::azerbaijan(),
1405            Self::bahrain(),
1406            Self::bangladesh(),
1407            Self::barbados(),
1408            Self::belarus(),
1409            Self::belgium(),
1410            Self::belize(),
1411            Self::benin(),
1412            Self::bermuda(),
1413            Self::bhutan(),
1414            Self::bolivarian_republic_of_venezuela(),
1415            Self::bolivia(),
1416            Self::bonaire(),
1417            Self::bosnia_and_herzegovina(),
1418            Self::botswana(),
1419            Self::bouvet_island(),
1420            Self::brazil(),
1421            Self::british_indian_ocean_territory(),
1422            Self::british_virgin_islands(),
1423            Self::brunei_darussalam(),
1424            Self::bulgaria(),
1425            Self::burkina_faso(),
1426            Self::burundi(),
1427            Self::cabo_verde(),
1428            Self::cambodia(),
1429            Self::cameroon(),
1430            Self::canada(),
1431            Self::chad(),
1432            Self::chile(),
1433            Self::china(),
1434            Self::christmas_island(),
1435            Self::colombia(),
1436            Self::costa_rica(),
1437            Self::coted_ivoire(),
1438            Self::croatia(),
1439            Self::cuba(),
1440            Self::curacao(),
1441            Self::cyprus(),
1442            Self::czechia(),
1443            Self::denmark(),
1444            Self::djibouti(),
1445            Self::dominica(),
1446            Self::dutch_part_sint_maarten(),
1447            Self::ecuador(),
1448            Self::egypt(),
1449            Self::el_salvador(),
1450            Self::equatorial_guinea(),
1451            Self::eritrea(),
1452            Self::estonia(),
1453            Self::eswatini(),
1454            Self::ethiopia(),
1455            Self::federated_states_of_micronesia(),
1456            Self::fiji(),
1457            Self::finland(),
1458            Self::france(),
1459            Self::french_guiana(),
1460            Self::french_part_saint_martin(),
1461            Self::french_polynesia(),
1462            Self::gabon(),
1463            Self::georgia(),
1464            Self::germany(),
1465            Self::ghana(),
1466            Self::gibraltar(),
1467            Self::greece(),
1468            Self::greenland(),
1469            Self::grenada(),
1470            Self::guadeloupe(),
1471            Self::guam(),
1472            Self::guatemala(),
1473            Self::guernsey(),
1474            Self::guinea(),
1475            Self::guinea_bissau(),
1476            Self::guyana(),
1477            Self::haiti(),
1478            Self::heard_island_and_mc_donald_islands(),
1479            Self::honduras(),
1480            Self::hong_kong(),
1481            Self::hungary(),
1482            Self::iceland(),
1483            Self::india(),
1484            Self::indonesia(),
1485            Self::iraq(),
1486            Self::ireland(),
1487            Self::islamic_republic_of_iran(),
1488            Self::isle_of_man(),
1489            Self::israel(),
1490            Self::italy(),
1491            Self::jamaica(),
1492            Self::japan(),
1493            Self::jersey(),
1494            Self::jordan(),
1495            Self::kazakhstan(),
1496            Self::kenya(),
1497            Self::kiribati(),
1498            Self::kosovo(),
1499            Self::kuwait(),
1500            Self::kyrgyzstan(),
1501            Self::latvia(),
1502            Self::lebanon(),
1503            Self::lesotho(),
1504            Self::liberia(),
1505            Self::libya(),
1506            Self::liechtenstein(),
1507            Self::lithuania(),
1508            Self::luxembourg(),
1509            Self::macao(),
1510            Self::madagascar(),
1511            Self::malawi(),
1512            Self::malaysia(),
1513            Self::maldives(),
1514            Self::mali(),
1515            Self::malta(),
1516            Self::martinique(),
1517            Self::mauritania(),
1518            Self::mauritius(),
1519            Self::mayotte(),
1520            Self::mexico(),
1521            Self::monaco(),
1522            Self::mongolia(),
1523            Self::montenegro(),
1524            Self::montserrat(),
1525            Self::morocco(),
1526            Self::mozambique(),
1527            Self::myanmar(),
1528            Self::namibia(),
1529            Self::nauru(),
1530            Self::nepal(),
1531            Self::new_caledonia(),
1532            Self::new_zealand(),
1533            Self::nicaragua(),
1534            Self::nigeria(),
1535            Self::niue(),
1536            Self::norfolk_island(),
1537            Self::norway(),
1538            Self::oman(),
1539            Self::pakistan(),
1540            Self::palau(),
1541            Self::panama(),
1542            Self::papua_new_guinea(),
1543            Self::paraguay(),
1544            Self::peru(),
1545            Self::pitcairn(),
1546            Self::poland(),
1547            Self::portugal(),
1548            Self::puerto_rico(),
1549            Self::qatar(),
1550            Self::republic_of_north_macedonia(),
1551            Self::reunion(),
1552            Self::romania(),
1553            Self::rwanda(),
1554            Self::saint_barthelemy(),
1555            Self::saint_kitts_and_nevis(),
1556            Self::saint_lucia(),
1557            Self::saint_pierre_and_miquelon(),
1558            Self::saint_vincent_and_the_grenadines(),
1559            Self::samoa(),
1560            Self::san_marino(),
1561            Self::sao_tome_and_principe(),
1562            Self::saudi_arabia(),
1563            Self::senegal(),
1564            Self::serbia(),
1565            Self::seychelles(),
1566            Self::sierra_leone(),
1567            Self::singapore(),
1568            Self::slovakia(),
1569            Self::slovenia(),
1570            Self::solomon_islands(),
1571            Self::somalia(),
1572            Self::south_africa(),
1573            Self::south_georgia_and_the_south_sandwich_islands(),
1574            Self::south_sudan(),
1575            Self::spain(),
1576            Self::sri_lanka(),
1577            Self::state_of_palestine(),
1578            Self::suriname(),
1579            Self::svalbard_and_jan_mayen(),
1580            Self::sweden(),
1581            Self::switzerland(),
1582            Self::syrian_arab_republic(),
1583            Self::taiwan(),
1584            Self::tajikistan(),
1585            Self::thailand(),
1586            Self::the_bahamas(),
1587            Self::the_cayman_islands(),
1588            Self::the_central_african_republic(),
1589            Self::the_cocos_keeling_islands(),
1590            Self::the_comoros(),
1591            Self::the_congo(),
1592            Self::the_cook_islands(),
1593            Self::the_democratic_peoples_republic_of_korea(),
1594            Self::the_democratic_republic_of_the_congo(),
1595            Self::the_dominican_republic(),
1596            Self::the_falkland_islands_malvinas(),
1597            Self::the_faroe_islands(),
1598            Self::the_french_southern_territories(),
1599            Self::the_gambia(),
1600            Self::the_holy_see(),
1601            Self::the_lao_peoples_democratic_republic(),
1602            Self::the_marshall_islands(),
1603            Self::the_netherlands(),
1604            Self::the_niger(),
1605            Self::the_northern_mariana_islands(),
1606            Self::the_philippines(),
1607            Self::the_republic_of_korea(),
1608            Self::the_republic_of_moldova(),
1609            Self::the_russian_federation(),
1610            Self::the_sudan(),
1611            Self::the_turks_and_caicos_islands(),
1612            Self::the_united_arab_emirates(),
1613            Self::the_united_kingdom_of_great_britain_and_northern_ireland(),
1614            Self::the_united_states_minor_outlying_islands(),
1615            Self::the_united_states_of_america(),
1616            Self::timor_leste(),
1617            Self::togo(),
1618            Self::tokelau(),
1619            Self::tonga(),
1620            Self::trinidad_and_tobago(),
1621            Self::tunisia(),
1622            Self::turkey(),
1623            Self::turkmenistan(),
1624            Self::tuvalu(),
1625            Self::us_virgin_islands(),
1626            Self::uganda(),
1627            Self::ukraine(),
1628            Self::united_republic_of_tanzania(),
1629            Self::uruguay(),
1630            Self::uzbekistan(),
1631            Self::vanuatu(),
1632            Self::vietnam(),
1633            Self::wallis_and_futuna(),
1634            Self::western_sahara(),
1635            Self::yemen(),
1636            Self::zambia(),
1637            Self::zimbabwe(),
1638        ]
1639    }
1640
1641    /// Given the numeric code, return a country or an error if
1642    /// the parameter doesn't match any country
1643    ///
1644    /// ```
1645    /// use celes::Country;
1646    ///
1647    /// let res = Country::from_value(1);
1648    /// assert!(res.is_err());
1649    ///
1650    /// let res = Country::from_value(2);
1651    /// assert!(res.is_err());
1652    ///
1653    /// let res = Country::from_value(4);
1654    /// assert!(res.is_ok());
1655    ///
1656    /// assert_eq!(Country::afghanistan(), res.unwrap());
1657    /// ```
1658    pub fn from_value(value: usize) -> Result<Self, &'static str> {
1659        static VALUES: Map<usize, Country> = phf_map! {
1660            4usize => Country::afghanistan(),
1661            248usize => Country::aland_islands(),
1662            8usize => Country::albania(),
1663            12usize => Country::algeria(),
1664            16usize => Country::american_samoa(),
1665            20usize => Country::andorra(),
1666            24usize => Country::angola(),
1667            660usize => Country::anguilla(),
1668            10usize => Country::antarctica(),
1669            28usize => Country::antigua_and_barbuda(),
1670            32usize => Country::argentina(),
1671            51usize => Country::armenia(),
1672            533usize => Country::aruba(),
1673            654usize => Country::ascension_and_tristan_da_cunha_saint_helena(),
1674            36usize => Country::australia(),
1675            40usize => Country::austria(),
1676            31usize => Country::azerbaijan(),
1677            48usize => Country::bahrain(),
1678            50usize => Country::bangladesh(),
1679            52usize => Country::barbados(),
1680            112usize => Country::belarus(),
1681            56usize => Country::belgium(),
1682            84usize => Country::belize(),
1683            204usize => Country::benin(),
1684            60usize => Country::bermuda(),
1685            64usize => Country::bhutan(),
1686            862usize => Country::bolivarian_republic_of_venezuela(),
1687            68usize => Country::bolivia(),
1688            535usize => Country::bonaire(),
1689            70usize => Country::bosnia_and_herzegovina(),
1690            72usize => Country::botswana(),
1691            74usize => Country::bouvet_island(),
1692            76usize => Country::brazil(),
1693            86usize => Country::british_indian_ocean_territory(),
1694            92usize => Country::british_virgin_islands(),
1695            96usize => Country::brunei_darussalam(),
1696            100usize => Country::bulgaria(),
1697            854usize => Country::burkina_faso(),
1698            108usize => Country::burundi(),
1699            132usize => Country::cabo_verde(),
1700            116usize => Country::cambodia(),
1701            120usize => Country::cameroon(),
1702            124usize => Country::canada(),
1703            148usize => Country::chad(),
1704            152usize => Country::chile(),
1705            156usize => Country::china(),
1706            162usize => Country::christmas_island(),
1707            170usize => Country::colombia(),
1708            188usize => Country::costa_rica(),
1709            384usize => Country::coted_ivoire(),
1710            191usize => Country::croatia(),
1711            192usize => Country::cuba(),
1712            531usize => Country::curacao(),
1713            196usize => Country::cyprus(),
1714            203usize => Country::czechia(),
1715            208usize => Country::denmark(),
1716            262usize => Country::djibouti(),
1717            212usize => Country::dominica(),
1718            534usize => Country::dutch_part_sint_maarten(),
1719            218usize => Country::ecuador(),
1720            818usize => Country::egypt(),
1721            222usize => Country::el_salvador(),
1722            226usize => Country::equatorial_guinea(),
1723            232usize => Country::eritrea(),
1724            233usize => Country::estonia(),
1725            748usize => Country::eswatini(),
1726            231usize => Country::ethiopia(),
1727            583usize => Country::federated_states_of_micronesia(),
1728            242usize => Country::fiji(),
1729            246usize => Country::finland(),
1730            250usize => Country::france(),
1731            254usize => Country::french_guiana(),
1732            663usize => Country::french_part_saint_martin(),
1733            258usize => Country::french_polynesia(),
1734            266usize => Country::gabon(),
1735            268usize => Country::georgia(),
1736            276usize => Country::germany(),
1737            288usize => Country::ghana(),
1738            292usize => Country::gibraltar(),
1739            300usize => Country::greece(),
1740            304usize => Country::greenland(),
1741            308usize => Country::grenada(),
1742            312usize => Country::guadeloupe(),
1743            316usize => Country::guam(),
1744            320usize => Country::guatemala(),
1745            831usize => Country::guernsey(),
1746            324usize => Country::guinea(),
1747            624usize => Country::guinea_bissau(),
1748            328usize => Country::guyana(),
1749            332usize => Country::haiti(),
1750            334usize => Country::heard_island_and_mc_donald_islands(),
1751            340usize => Country::honduras(),
1752            344usize => Country::hong_kong(),
1753            348usize => Country::hungary(),
1754            352usize => Country::iceland(),
1755            356usize => Country::india(),
1756            360usize => Country::indonesia(),
1757            368usize => Country::iraq(),
1758            372usize => Country::ireland(),
1759            364usize => Country::islamic_republic_of_iran(),
1760            833usize => Country::isle_of_man(),
1761            376usize => Country::israel(),
1762            380usize => Country::italy(),
1763            388usize => Country::jamaica(),
1764            392usize => Country::japan(),
1765            832usize => Country::jersey(),
1766            400usize => Country::jordan(),
1767            398usize => Country::kazakhstan(),
1768            404usize => Country::kenya(),
1769            296usize => Country::kiribati(),
1770            383usize => Country::kosovo(),
1771            414usize => Country::kuwait(),
1772            417usize => Country::kyrgyzstan(),
1773            428usize => Country::latvia(),
1774            422usize => Country::lebanon(),
1775            426usize => Country::lesotho(),
1776            430usize => Country::liberia(),
1777            434usize => Country::libya(),
1778            438usize => Country::liechtenstein(),
1779            440usize => Country::lithuania(),
1780            442usize => Country::luxembourg(),
1781            446usize => Country::macao(),
1782            450usize => Country::madagascar(),
1783            454usize => Country::malawi(),
1784            458usize => Country::malaysia(),
1785            462usize => Country::maldives(),
1786            466usize => Country::mali(),
1787            470usize => Country::malta(),
1788            474usize => Country::martinique(),
1789            478usize => Country::mauritania(),
1790            480usize => Country::mauritius(),
1791            175usize => Country::mayotte(),
1792            484usize => Country::mexico(),
1793            492usize => Country::monaco(),
1794            496usize => Country::mongolia(),
1795            499usize => Country::montenegro(),
1796            500usize => Country::montserrat(),
1797            504usize => Country::morocco(),
1798            508usize => Country::mozambique(),
1799            104usize => Country::myanmar(),
1800            516usize => Country::namibia(),
1801            520usize => Country::nauru(),
1802            524usize => Country::nepal(),
1803            540usize => Country::new_caledonia(),
1804            554usize => Country::new_zealand(),
1805            558usize => Country::nicaragua(),
1806            566usize => Country::nigeria(),
1807            570usize => Country::niue(),
1808            574usize => Country::norfolk_island(),
1809            578usize => Country::norway(),
1810            512usize => Country::oman(),
1811            586usize => Country::pakistan(),
1812            585usize => Country::palau(),
1813            591usize => Country::panama(),
1814            598usize => Country::papua_new_guinea(),
1815            600usize => Country::paraguay(),
1816            604usize => Country::peru(),
1817            612usize => Country::pitcairn(),
1818            616usize => Country::poland(),
1819            620usize => Country::portugal(),
1820            630usize => Country::puerto_rico(),
1821            634usize => Country::qatar(),
1822            807usize => Country::republic_of_north_macedonia(),
1823            638usize => Country::reunion(),
1824            642usize => Country::romania(),
1825            646usize => Country::rwanda(),
1826            652usize => Country::saint_barthelemy(),
1827            659usize => Country::saint_kitts_and_nevis(),
1828            662usize => Country::saint_lucia(),
1829            666usize => Country::saint_pierre_and_miquelon(),
1830            670usize => Country::saint_vincent_and_the_grenadines(),
1831            882usize => Country::samoa(),
1832            674usize => Country::san_marino(),
1833            678usize => Country::sao_tome_and_principe(),
1834            682usize => Country::saudi_arabia(),
1835            686usize => Country::senegal(),
1836            688usize => Country::serbia(),
1837            690usize => Country::seychelles(),
1838            694usize => Country::sierra_leone(),
1839            702usize => Country::singapore(),
1840            703usize => Country::slovakia(),
1841            705usize => Country::slovenia(),
1842            90usize => Country::solomon_islands(),
1843            706usize => Country::somalia(),
1844            710usize => Country::south_africa(),
1845            239usize => Country::south_georgia_and_the_south_sandwich_islands(),
1846            728usize => Country::south_sudan(),
1847            724usize => Country::spain(),
1848            144usize => Country::sri_lanka(),
1849            275usize => Country::state_of_palestine(),
1850            740usize => Country::suriname(),
1851            744usize => Country::svalbard_and_jan_mayen(),
1852            752usize => Country::sweden(),
1853            756usize => Country::switzerland(),
1854            760usize => Country::syrian_arab_republic(),
1855            158usize => Country::taiwan(),
1856            762usize => Country::tajikistan(),
1857            764usize => Country::thailand(),
1858            44usize => Country::the_bahamas(),
1859            136usize => Country::the_cayman_islands(),
1860            140usize => Country::the_central_african_republic(),
1861            166usize => Country::the_cocos_keeling_islands(),
1862            174usize => Country::the_comoros(),
1863            178usize => Country::the_congo(),
1864            184usize => Country::the_cook_islands(),
1865            408usize => Country::the_democratic_peoples_republic_of_korea(),
1866            180usize => Country::the_democratic_republic_of_the_congo(),
1867            214usize => Country::the_dominican_republic(),
1868            238usize => Country::the_falkland_islands_malvinas(),
1869            234usize => Country::the_faroe_islands(),
1870            260usize => Country::the_french_southern_territories(),
1871            270usize => Country::the_gambia(),
1872            336usize => Country::the_holy_see(),
1873            418usize => Country::the_lao_peoples_democratic_republic(),
1874            584usize => Country::the_marshall_islands(),
1875            528usize => Country::the_netherlands(),
1876            562usize => Country::the_niger(),
1877            580usize => Country::the_northern_mariana_islands(),
1878            608usize => Country::the_philippines(),
1879            410usize => Country::the_republic_of_korea(),
1880            498usize => Country::the_republic_of_moldova(),
1881            643usize => Country::the_russian_federation(),
1882            729usize => Country::the_sudan(),
1883            796usize => Country::the_turks_and_caicos_islands(),
1884            784usize => Country::the_united_arab_emirates(),
1885            826usize => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
1886            581usize => Country::the_united_states_minor_outlying_islands(),
1887            840usize => Country::the_united_states_of_america(),
1888            626usize => Country::timor_leste(),
1889            768usize => Country::togo(),
1890            772usize => Country::tokelau(),
1891            776usize => Country::tonga(),
1892            780usize => Country::trinidad_and_tobago(),
1893            788usize => Country::tunisia(),
1894            792usize => Country::turkey(),
1895            795usize => Country::turkmenistan(),
1896            798usize => Country::tuvalu(),
1897            850usize => Country::us_virgin_islands(),
1898            800usize => Country::uganda(),
1899            804usize => Country::ukraine(),
1900            834usize => Country::united_republic_of_tanzania(),
1901            858usize => Country::uruguay(),
1902            860usize => Country::uzbekistan(),
1903            548usize => Country::vanuatu(),
1904            704usize => Country::vietnam(),
1905            876usize => Country::wallis_and_futuna(),
1906            732usize => Country::western_sahara(),
1907            887usize => Country::yemen(),
1908            894usize => Country::zambia(),
1909            716usize => Country::zimbabwe(),
1910        };
1911        VALUES.get(&value).copied().ok_or("invalid value")
1912    }
1913
1914    /// Given the three digit code, return a country or an error if
1915    /// the parameter doesn't match any country. The value MUST be
1916    /// the three digit code which includes leading zeros.
1917    ///
1918    /// ```
1919    /// use celes::Country;
1920    ///
1921    /// let res = Country::from_code("8");
1922    /// assert!(res.is_err());
1923    ///
1924    /// let res = Country::from_code("08");
1925    /// assert!(res.is_err());
1926    ///
1927    /// let res = Country::from_code("008");
1928    /// assert!(res.is_ok());
1929    ///
1930    /// assert_eq!(Country::albania(), res.unwrap());
1931    /// ```
1932    pub fn from_code<A: AsRef<str>>(code: A) -> Result<Self, &'static str> {
1933        static CODES: Map<&'static str, Country> = phf_map! {
1934            "004" => Country::afghanistan(),
1935            "248" => Country::aland_islands(),
1936            "008" => Country::albania(),
1937            "012" => Country::algeria(),
1938            "016" => Country::american_samoa(),
1939            "020" => Country::andorra(),
1940            "024" => Country::angola(),
1941            "660" => Country::anguilla(),
1942            "010" => Country::antarctica(),
1943            "028" => Country::antigua_and_barbuda(),
1944            "032" => Country::argentina(),
1945            "051" => Country::armenia(),
1946            "533" => Country::aruba(),
1947            "654" => Country::ascension_and_tristan_da_cunha_saint_helena(),
1948            "036" => Country::australia(),
1949            "040" => Country::austria(),
1950            "031" => Country::azerbaijan(),
1951            "048" => Country::bahrain(),
1952            "050" => Country::bangladesh(),
1953            "052" => Country::barbados(),
1954            "112" => Country::belarus(),
1955            "056" => Country::belgium(),
1956            "084" => Country::belize(),
1957            "204" => Country::benin(),
1958            "060" => Country::bermuda(),
1959            "064" => Country::bhutan(),
1960            "862" => Country::bolivarian_republic_of_venezuela(),
1961            "068" => Country::bolivia(),
1962            "535" => Country::bonaire(),
1963            "070" => Country::bosnia_and_herzegovina(),
1964            "072" => Country::botswana(),
1965            "074" => Country::bouvet_island(),
1966            "076" => Country::brazil(),
1967            "086" => Country::british_indian_ocean_territory(),
1968            "092" => Country::british_virgin_islands(),
1969            "096" => Country::brunei_darussalam(),
1970            "100" => Country::bulgaria(),
1971            "854" => Country::burkina_faso(),
1972            "108" => Country::burundi(),
1973            "132" => Country::cabo_verde(),
1974            "116" => Country::cambodia(),
1975            "120" => Country::cameroon(),
1976            "124" => Country::canada(),
1977            "148" => Country::chad(),
1978            "152" => Country::chile(),
1979            "156" => Country::china(),
1980            "162" => Country::christmas_island(),
1981            "170" => Country::colombia(),
1982            "188" => Country::costa_rica(),
1983            "384" => Country::coted_ivoire(),
1984            "191" => Country::croatia(),
1985            "192" => Country::cuba(),
1986            "531" => Country::curacao(),
1987            "196" => Country::cyprus(),
1988            "203" => Country::czechia(),
1989            "208" => Country::denmark(),
1990            "262" => Country::djibouti(),
1991            "212" => Country::dominica(),
1992            "534" => Country::dutch_part_sint_maarten(),
1993            "218" => Country::ecuador(),
1994            "818" => Country::egypt(),
1995            "222" => Country::el_salvador(),
1996            "226" => Country::equatorial_guinea(),
1997            "232" => Country::eritrea(),
1998            "233" => Country::estonia(),
1999            "748" => Country::eswatini(),
2000            "231" => Country::ethiopia(),
2001            "583" => Country::federated_states_of_micronesia(),
2002            "242" => Country::fiji(),
2003            "246" => Country::finland(),
2004            "250" => Country::france(),
2005            "254" => Country::french_guiana(),
2006            "663" => Country::french_part_saint_martin(),
2007            "258" => Country::french_polynesia(),
2008            "266" => Country::gabon(),
2009            "268" => Country::georgia(),
2010            "276" => Country::germany(),
2011            "288" => Country::ghana(),
2012            "292" => Country::gibraltar(),
2013            "300" => Country::greece(),
2014            "304" => Country::greenland(),
2015            "308" => Country::grenada(),
2016            "312" => Country::guadeloupe(),
2017            "316" => Country::guam(),
2018            "320" => Country::guatemala(),
2019            "831" => Country::guernsey(),
2020            "324" => Country::guinea(),
2021            "624" => Country::guinea_bissau(),
2022            "328" => Country::guyana(),
2023            "332" => Country::haiti(),
2024            "334" => Country::heard_island_and_mc_donald_islands(),
2025            "340" => Country::honduras(),
2026            "344" => Country::hong_kong(),
2027            "348" => Country::hungary(),
2028            "352" => Country::iceland(),
2029            "356" => Country::india(),
2030            "360" => Country::indonesia(),
2031            "368" => Country::iraq(),
2032            "372" => Country::ireland(),
2033            "364" => Country::islamic_republic_of_iran(),
2034            "833" => Country::isle_of_man(),
2035            "376" => Country::israel(),
2036            "380" => Country::italy(),
2037            "388" => Country::jamaica(),
2038            "392" => Country::japan(),
2039            "832" => Country::jersey(),
2040            "400" => Country::jordan(),
2041            "398" => Country::kazakhstan(),
2042            "404" => Country::kenya(),
2043            "296" => Country::kiribati(),
2044            "383" => Country::kosovo(),
2045            "414" => Country::kuwait(),
2046            "417" => Country::kyrgyzstan(),
2047            "428" => Country::latvia(),
2048            "422" => Country::lebanon(),
2049            "426" => Country::lesotho(),
2050            "430" => Country::liberia(),
2051            "434" => Country::libya(),
2052            "438" => Country::liechtenstein(),
2053            "440" => Country::lithuania(),
2054            "442" => Country::luxembourg(),
2055            "446" => Country::macao(),
2056            "450" => Country::madagascar(),
2057            "454" => Country::malawi(),
2058            "458" => Country::malaysia(),
2059            "462" => Country::maldives(),
2060            "466" => Country::mali(),
2061            "470" => Country::malta(),
2062            "474" => Country::martinique(),
2063            "478" => Country::mauritania(),
2064            "480" => Country::mauritius(),
2065            "175" => Country::mayotte(),
2066            "484" => Country::mexico(),
2067            "492" => Country::monaco(),
2068            "496" => Country::mongolia(),
2069            "499" => Country::montenegro(),
2070            "500" => Country::montserrat(),
2071            "504" => Country::morocco(),
2072            "508" => Country::mozambique(),
2073            "104" => Country::myanmar(),
2074            "516" => Country::namibia(),
2075            "520" => Country::nauru(),
2076            "524" => Country::nepal(),
2077            "540" => Country::new_caledonia(),
2078            "554" => Country::new_zealand(),
2079            "558" => Country::nicaragua(),
2080            "566" => Country::nigeria(),
2081            "570" => Country::niue(),
2082            "574" => Country::norfolk_island(),
2083            "578" => Country::norway(),
2084            "512" => Country::oman(),
2085            "586" => Country::pakistan(),
2086            "585" => Country::palau(),
2087            "591" => Country::panama(),
2088            "598" => Country::papua_new_guinea(),
2089            "600" => Country::paraguay(),
2090            "604" => Country::peru(),
2091            "612" => Country::pitcairn(),
2092            "616" => Country::poland(),
2093            "620" => Country::portugal(),
2094            "630" => Country::puerto_rico(),
2095            "634" => Country::qatar(),
2096            "807" => Country::republic_of_north_macedonia(),
2097            "638" => Country::reunion(),
2098            "642" => Country::romania(),
2099            "646" => Country::rwanda(),
2100            "652" => Country::saint_barthelemy(),
2101            "659" => Country::saint_kitts_and_nevis(),
2102            "662" => Country::saint_lucia(),
2103            "666" => Country::saint_pierre_and_miquelon(),
2104            "670" => Country::saint_vincent_and_the_grenadines(),
2105            "882" => Country::samoa(),
2106            "674" => Country::san_marino(),
2107            "678" => Country::sao_tome_and_principe(),
2108            "682" => Country::saudi_arabia(),
2109            "686" => Country::senegal(),
2110            "688" => Country::serbia(),
2111            "690" => Country::seychelles(),
2112            "694" => Country::sierra_leone(),
2113            "702" => Country::singapore(),
2114            "703" => Country::slovakia(),
2115            "705" => Country::slovenia(),
2116            "090" => Country::solomon_islands(),
2117            "706" => Country::somalia(),
2118            "710" => Country::south_africa(),
2119            "239" => Country::south_georgia_and_the_south_sandwich_islands(),
2120            "728" => Country::south_sudan(),
2121            "724" => Country::spain(),
2122            "144" => Country::sri_lanka(),
2123            "275" => Country::state_of_palestine(),
2124            "740" => Country::suriname(),
2125            "744" => Country::svalbard_and_jan_mayen(),
2126            "752" => Country::sweden(),
2127            "756" => Country::switzerland(),
2128            "760" => Country::syrian_arab_republic(),
2129            "158" => Country::taiwan(),
2130            "762" => Country::tajikistan(),
2131            "764" => Country::thailand(),
2132            "044" => Country::the_bahamas(),
2133            "136" => Country::the_cayman_islands(),
2134            "140" => Country::the_central_african_republic(),
2135            "166" => Country::the_cocos_keeling_islands(),
2136            "174" => Country::the_comoros(),
2137            "178" => Country::the_congo(),
2138            "184" => Country::the_cook_islands(),
2139            "408" => Country::the_democratic_peoples_republic_of_korea(),
2140            "180" => Country::the_democratic_republic_of_the_congo(),
2141            "214" => Country::the_dominican_republic(),
2142            "238" => Country::the_falkland_islands_malvinas(),
2143            "234" => Country::the_faroe_islands(),
2144            "260" => Country::the_french_southern_territories(),
2145            "270" => Country::the_gambia(),
2146            "336" => Country::the_holy_see(),
2147            "418" => Country::the_lao_peoples_democratic_republic(),
2148            "584" => Country::the_marshall_islands(),
2149            "528" => Country::the_netherlands(),
2150            "562" => Country::the_niger(),
2151            "580" => Country::the_northern_mariana_islands(),
2152            "608" => Country::the_philippines(),
2153            "410" => Country::the_republic_of_korea(),
2154            "498" => Country::the_republic_of_moldova(),
2155            "643" => Country::the_russian_federation(),
2156            "729" => Country::the_sudan(),
2157            "796" => Country::the_turks_and_caicos_islands(),
2158            "784" => Country::the_united_arab_emirates(),
2159            "826" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2160            "581" => Country::the_united_states_minor_outlying_islands(),
2161            "840" => Country::the_united_states_of_america(),
2162            "626" => Country::timor_leste(),
2163            "768" => Country::togo(),
2164            "772" => Country::tokelau(),
2165            "776" => Country::tonga(),
2166            "780" => Country::trinidad_and_tobago(),
2167            "788" => Country::tunisia(),
2168            "792" => Country::turkey(),
2169            "795" => Country::turkmenistan(),
2170            "798" => Country::tuvalu(),
2171            "850" => Country::us_virgin_islands(),
2172            "800" => Country::uganda(),
2173            "804" => Country::ukraine(),
2174            "834" => Country::united_republic_of_tanzania(),
2175            "858" => Country::uruguay(),
2176            "860" => Country::uzbekistan(),
2177            "548" => Country::vanuatu(),
2178            "704" => Country::vietnam(),
2179            "876" => Country::wallis_and_futuna(),
2180            "732" => Country::western_sahara(),
2181            "887" => Country::yemen(),
2182            "894" => Country::zambia(),
2183            "716" => Country::zimbabwe(),
2184        };
2185        CODES
2186            .get(code.as_ref())
2187            .copied()
2188            .ok_or("invalid code")
2189    }
2190
2191    /// Given the alpha2 letters, return a country or an error if
2192    /// the parameter doesn't match any country. This is case-insensitive.
2193    ///
2194    /// ```
2195    /// use celes::Country;
2196    ///
2197    /// let res = Country::from_alpha2("u");
2198    /// assert!(res.is_err());
2199    ///
2200    /// let res = Country::from_alpha2("us");
2201    /// assert!(res.is_ok());
2202    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2203    ///
2204    /// let res = Country::from_alpha2("Us");
2205    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2206    ///
2207    /// let res = Country::from_alpha2("uS");
2208    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2209    ///
2210    /// let res = Country::from_alpha2("US");
2211    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2212    /// ```
2213    pub fn from_alpha2<A: AsRef<str>>(alpha2: A) -> Result<Self, &'static str> {
2214        static ALPHA2: Map<&'static str, Country> = phf_map! {
2215            "af" => Country::afghanistan(),
2216            "ax" => Country::aland_islands(),
2217            "al" => Country::albania(),
2218            "dz" => Country::algeria(),
2219            "as" => Country::american_samoa(),
2220            "ad" => Country::andorra(),
2221            "ao" => Country::angola(),
2222            "ai" => Country::anguilla(),
2223            "aq" => Country::antarctica(),
2224            "ag" => Country::antigua_and_barbuda(),
2225            "ar" => Country::argentina(),
2226            "am" => Country::armenia(),
2227            "aw" => Country::aruba(),
2228            "sh" => Country::ascension_and_tristan_da_cunha_saint_helena(),
2229            "au" => Country::australia(),
2230            "at" => Country::austria(),
2231            "az" => Country::azerbaijan(),
2232            "bh" => Country::bahrain(),
2233            "bd" => Country::bangladesh(),
2234            "bb" => Country::barbados(),
2235            "by" => Country::belarus(),
2236            "be" => Country::belgium(),
2237            "bz" => Country::belize(),
2238            "bj" => Country::benin(),
2239            "bm" => Country::bermuda(),
2240            "bt" => Country::bhutan(),
2241            "ve" => Country::bolivarian_republic_of_venezuela(),
2242            "bo" => Country::bolivia(),
2243            "bq" => Country::bonaire(),
2244            "ba" => Country::bosnia_and_herzegovina(),
2245            "bw" => Country::botswana(),
2246            "bv" => Country::bouvet_island(),
2247            "br" => Country::brazil(),
2248            "io" => Country::british_indian_ocean_territory(),
2249            "vg" => Country::british_virgin_islands(),
2250            "bn" => Country::brunei_darussalam(),
2251            "bg" => Country::bulgaria(),
2252            "bf" => Country::burkina_faso(),
2253            "bi" => Country::burundi(),
2254            "cv" => Country::cabo_verde(),
2255            "kh" => Country::cambodia(),
2256            "cm" => Country::cameroon(),
2257            "ca" => Country::canada(),
2258            "td" => Country::chad(),
2259            "cl" => Country::chile(),
2260            "cn" => Country::china(),
2261            "cx" => Country::christmas_island(),
2262            "co" => Country::colombia(),
2263            "cr" => Country::costa_rica(),
2264            "ci" => Country::coted_ivoire(),
2265            "hr" => Country::croatia(),
2266            "cu" => Country::cuba(),
2267            "cw" => Country::curacao(),
2268            "cy" => Country::cyprus(),
2269            "cz" => Country::czechia(),
2270            "dk" => Country::denmark(),
2271            "dj" => Country::djibouti(),
2272            "dm" => Country::dominica(),
2273            "sx" => Country::dutch_part_sint_maarten(),
2274            "ec" => Country::ecuador(),
2275            "eg" => Country::egypt(),
2276            "sv" => Country::el_salvador(),
2277            "gq" => Country::equatorial_guinea(),
2278            "er" => Country::eritrea(),
2279            "ee" => Country::estonia(),
2280            "sz" => Country::eswatini(),
2281            "et" => Country::ethiopia(),
2282            "fm" => Country::federated_states_of_micronesia(),
2283            "fj" => Country::fiji(),
2284            "fi" => Country::finland(),
2285            "fr" => Country::france(),
2286            "gf" => Country::french_guiana(),
2287            "mf" => Country::french_part_saint_martin(),
2288            "pf" => Country::french_polynesia(),
2289            "ga" => Country::gabon(),
2290            "ge" => Country::georgia(),
2291            "de" => Country::germany(),
2292            "gh" => Country::ghana(),
2293            "gi" => Country::gibraltar(),
2294            "gr" => Country::greece(),
2295            "gl" => Country::greenland(),
2296            "gd" => Country::grenada(),
2297            "gp" => Country::guadeloupe(),
2298            "gu" => Country::guam(),
2299            "gt" => Country::guatemala(),
2300            "gg" => Country::guernsey(),
2301            "gn" => Country::guinea(),
2302            "gw" => Country::guinea_bissau(),
2303            "gy" => Country::guyana(),
2304            "ht" => Country::haiti(),
2305            "hm" => Country::heard_island_and_mc_donald_islands(),
2306            "hn" => Country::honduras(),
2307            "hk" => Country::hong_kong(),
2308            "hu" => Country::hungary(),
2309            "is" => Country::iceland(),
2310            "in" => Country::india(),
2311            "id" => Country::indonesia(),
2312            "iq" => Country::iraq(),
2313            "ie" => Country::ireland(),
2314            "ir" => Country::islamic_republic_of_iran(),
2315            "im" => Country::isle_of_man(),
2316            "il" => Country::israel(),
2317            "it" => Country::italy(),
2318            "jm" => Country::jamaica(),
2319            "jp" => Country::japan(),
2320            "je" => Country::jersey(),
2321            "jo" => Country::jordan(),
2322            "kz" => Country::kazakhstan(),
2323            "ke" => Country::kenya(),
2324            "ki" => Country::kiribati(),
2325            "xk" => Country::kosovo(),
2326            "kw" => Country::kuwait(),
2327            "kg" => Country::kyrgyzstan(),
2328            "lv" => Country::latvia(),
2329            "lb" => Country::lebanon(),
2330            "ls" => Country::lesotho(),
2331            "lr" => Country::liberia(),
2332            "ly" => Country::libya(),
2333            "li" => Country::liechtenstein(),
2334            "lt" => Country::lithuania(),
2335            "lu" => Country::luxembourg(),
2336            "mo" => Country::macao(),
2337            "mg" => Country::madagascar(),
2338            "mw" => Country::malawi(),
2339            "my" => Country::malaysia(),
2340            "mv" => Country::maldives(),
2341            "ml" => Country::mali(),
2342            "mt" => Country::malta(),
2343            "mq" => Country::martinique(),
2344            "mr" => Country::mauritania(),
2345            "mu" => Country::mauritius(),
2346            "yt" => Country::mayotte(),
2347            "mx" => Country::mexico(),
2348            "mc" => Country::monaco(),
2349            "mn" => Country::mongolia(),
2350            "me" => Country::montenegro(),
2351            "ms" => Country::montserrat(),
2352            "ma" => Country::morocco(),
2353            "mz" => Country::mozambique(),
2354            "mm" => Country::myanmar(),
2355            "na" => Country::namibia(),
2356            "nr" => Country::nauru(),
2357            "np" => Country::nepal(),
2358            "nc" => Country::new_caledonia(),
2359            "nz" => Country::new_zealand(),
2360            "ni" => Country::nicaragua(),
2361            "ng" => Country::nigeria(),
2362            "nu" => Country::niue(),
2363            "nf" => Country::norfolk_island(),
2364            "no" => Country::norway(),
2365            "om" => Country::oman(),
2366            "pk" => Country::pakistan(),
2367            "pw" => Country::palau(),
2368            "pa" => Country::panama(),
2369            "pg" => Country::papua_new_guinea(),
2370            "py" => Country::paraguay(),
2371            "pe" => Country::peru(),
2372            "pn" => Country::pitcairn(),
2373            "pl" => Country::poland(),
2374            "pt" => Country::portugal(),
2375            "pr" => Country::puerto_rico(),
2376            "qa" => Country::qatar(),
2377            "mk" => Country::republic_of_north_macedonia(),
2378            "re" => Country::reunion(),
2379            "ro" => Country::romania(),
2380            "rw" => Country::rwanda(),
2381            "bl" => Country::saint_barthelemy(),
2382            "kn" => Country::saint_kitts_and_nevis(),
2383            "lc" => Country::saint_lucia(),
2384            "pm" => Country::saint_pierre_and_miquelon(),
2385            "vc" => Country::saint_vincent_and_the_grenadines(),
2386            "ws" => Country::samoa(),
2387            "sm" => Country::san_marino(),
2388            "st" => Country::sao_tome_and_principe(),
2389            "sa" => Country::saudi_arabia(),
2390            "sn" => Country::senegal(),
2391            "rs" => Country::serbia(),
2392            "sc" => Country::seychelles(),
2393            "sl" => Country::sierra_leone(),
2394            "sg" => Country::singapore(),
2395            "sk" => Country::slovakia(),
2396            "si" => Country::slovenia(),
2397            "sb" => Country::solomon_islands(),
2398            "so" => Country::somalia(),
2399            "za" => Country::south_africa(),
2400            "gs" => Country::south_georgia_and_the_south_sandwich_islands(),
2401            "ss" => Country::south_sudan(),
2402            "es" => Country::spain(),
2403            "lk" => Country::sri_lanka(),
2404            "ps" => Country::state_of_palestine(),
2405            "sr" => Country::suriname(),
2406            "sj" => Country::svalbard_and_jan_mayen(),
2407            "se" => Country::sweden(),
2408            "ch" => Country::switzerland(),
2409            "sy" => Country::syrian_arab_republic(),
2410            "tw" => Country::taiwan(),
2411            "tj" => Country::tajikistan(),
2412            "th" => Country::thailand(),
2413            "bs" => Country::the_bahamas(),
2414            "ky" => Country::the_cayman_islands(),
2415            "cf" => Country::the_central_african_republic(),
2416            "cc" => Country::the_cocos_keeling_islands(),
2417            "km" => Country::the_comoros(),
2418            "cg" => Country::the_congo(),
2419            "ck" => Country::the_cook_islands(),
2420            "kp" => Country::the_democratic_peoples_republic_of_korea(),
2421            "cd" => Country::the_democratic_republic_of_the_congo(),
2422            "do" => Country::the_dominican_republic(),
2423            "fk" => Country::the_falkland_islands_malvinas(),
2424            "fo" => Country::the_faroe_islands(),
2425            "tf" => Country::the_french_southern_territories(),
2426            "gm" => Country::the_gambia(),
2427            "va" => Country::the_holy_see(),
2428            "la" => Country::the_lao_peoples_democratic_republic(),
2429            "mh" => Country::the_marshall_islands(),
2430            "nl" => Country::the_netherlands(),
2431            "ne" => Country::the_niger(),
2432            "mp" => Country::the_northern_mariana_islands(),
2433            "ph" => Country::the_philippines(),
2434            "kr" => Country::the_republic_of_korea(),
2435            "md" => Country::the_republic_of_moldova(),
2436            "ru" => Country::the_russian_federation(),
2437            "sd" => Country::the_sudan(),
2438            "tc" => Country::the_turks_and_caicos_islands(),
2439            "ae" => Country::the_united_arab_emirates(),
2440            "gb" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2441            "um" => Country::the_united_states_minor_outlying_islands(),
2442            "us" => Country::the_united_states_of_america(),
2443            "tl" => Country::timor_leste(),
2444            "tg" => Country::togo(),
2445            "tk" => Country::tokelau(),
2446            "to" => Country::tonga(),
2447            "tt" => Country::trinidad_and_tobago(),
2448            "tn" => Country::tunisia(),
2449            "tr" => Country::turkey(),
2450            "tm" => Country::turkmenistan(),
2451            "tv" => Country::tuvalu(),
2452            "vi" => Country::us_virgin_islands(),
2453            "ug" => Country::uganda(),
2454            "ua" => Country::ukraine(),
2455            "tz" => Country::united_republic_of_tanzania(),
2456            "uy" => Country::uruguay(),
2457            "uz" => Country::uzbekistan(),
2458            "vu" => Country::vanuatu(),
2459            "vn" => Country::vietnam(),
2460            "wf" => Country::wallis_and_futuna(),
2461            "eh" => Country::western_sahara(),
2462            "ye" => Country::yemen(),
2463            "zm" => Country::zambia(),
2464            "zw" => Country::zimbabwe(),
2465        };
2466        lookup_ascii_lowercase(&ALPHA2, alpha2.as_ref())
2467            .copied()
2468            .ok_or("invalid alpha2")
2469    }
2470
2471    /// Given the alpha3 letters, return a country or an error if
2472    /// the parameter doesn't match any country. This is case-insensitive.
2473    /// ```
2474    /// use celes::Country;
2475    ///
2476    /// let res = Country::from_alpha3("u");
2477    /// assert!(res.is_err());
2478    ///
2479    /// let res = Country::from_alpha3("us");
2480    /// assert!(res.is_err());
2481    ///
2482    /// let res = Country::from_alpha3("Usa");
2483    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2484    ///
2485    /// let res = Country::from_alpha3("uSa");
2486    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2487    ///
2488    /// let res = Country::from_alpha3("USA");
2489    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2490    /// ```
2491    pub fn from_alpha3<A: AsRef<str>>(alpha3: A) -> Result<Self, &'static str> {
2492        static ALPHA3: Map<&'static str, Country> = phf_map! {
2493            "afg" => Country::afghanistan(),
2494            "ala" => Country::aland_islands(),
2495            "alb" => Country::albania(),
2496            "dza" => Country::algeria(),
2497            "asm" => Country::american_samoa(),
2498            "and" => Country::andorra(),
2499            "ago" => Country::angola(),
2500            "aia" => Country::anguilla(),
2501            "ata" => Country::antarctica(),
2502            "atg" => Country::antigua_and_barbuda(),
2503            "arg" => Country::argentina(),
2504            "arm" => Country::armenia(),
2505            "abw" => Country::aruba(),
2506            "shn" => Country::ascension_and_tristan_da_cunha_saint_helena(),
2507            "aus" => Country::australia(),
2508            "aut" => Country::austria(),
2509            "aze" => Country::azerbaijan(),
2510            "bhr" => Country::bahrain(),
2511            "bgd" => Country::bangladesh(),
2512            "brb" => Country::barbados(),
2513            "blr" => Country::belarus(),
2514            "bel" => Country::belgium(),
2515            "blz" => Country::belize(),
2516            "ben" => Country::benin(),
2517            "bmu" => Country::bermuda(),
2518            "btn" => Country::bhutan(),
2519            "ven" => Country::bolivarian_republic_of_venezuela(),
2520            "bol" => Country::bolivia(),
2521            "bes" => Country::bonaire(),
2522            "bih" => Country::bosnia_and_herzegovina(),
2523            "bwa" => Country::botswana(),
2524            "bvt" => Country::bouvet_island(),
2525            "bra" => Country::brazil(),
2526            "iot" => Country::british_indian_ocean_territory(),
2527            "vgb" => Country::british_virgin_islands(),
2528            "brn" => Country::brunei_darussalam(),
2529            "bgr" => Country::bulgaria(),
2530            "bfa" => Country::burkina_faso(),
2531            "bdi" => Country::burundi(),
2532            "cpv" => Country::cabo_verde(),
2533            "khm" => Country::cambodia(),
2534            "cmr" => Country::cameroon(),
2535            "can" => Country::canada(),
2536            "tcd" => Country::chad(),
2537            "chl" => Country::chile(),
2538            "chn" => Country::china(),
2539            "cxr" => Country::christmas_island(),
2540            "col" => Country::colombia(),
2541            "cri" => Country::costa_rica(),
2542            "civ" => Country::coted_ivoire(),
2543            "hrv" => Country::croatia(),
2544            "cub" => Country::cuba(),
2545            "cuw" => Country::curacao(),
2546            "cyp" => Country::cyprus(),
2547            "cze" => Country::czechia(),
2548            "dnk" => Country::denmark(),
2549            "dji" => Country::djibouti(),
2550            "dma" => Country::dominica(),
2551            "sxm" => Country::dutch_part_sint_maarten(),
2552            "ecu" => Country::ecuador(),
2553            "egy" => Country::egypt(),
2554            "slv" => Country::el_salvador(),
2555            "gnq" => Country::equatorial_guinea(),
2556            "eri" => Country::eritrea(),
2557            "est" => Country::estonia(),
2558            "swz" => Country::eswatini(),
2559            "eth" => Country::ethiopia(),
2560            "fsm" => Country::federated_states_of_micronesia(),
2561            "fji" => Country::fiji(),
2562            "fin" => Country::finland(),
2563            "fra" => Country::france(),
2564            "guf" => Country::french_guiana(),
2565            "maf" => Country::french_part_saint_martin(),
2566            "pyf" => Country::french_polynesia(),
2567            "gab" => Country::gabon(),
2568            "geo" => Country::georgia(),
2569            "deu" => Country::germany(),
2570            "gha" => Country::ghana(),
2571            "gib" => Country::gibraltar(),
2572            "grc" => Country::greece(),
2573            "grl" => Country::greenland(),
2574            "grd" => Country::grenada(),
2575            "glp" => Country::guadeloupe(),
2576            "gum" => Country::guam(),
2577            "gtm" => Country::guatemala(),
2578            "ggy" => Country::guernsey(),
2579            "gin" => Country::guinea(),
2580            "gnb" => Country::guinea_bissau(),
2581            "guy" => Country::guyana(),
2582            "hti" => Country::haiti(),
2583            "hmd" => Country::heard_island_and_mc_donald_islands(),
2584            "hnd" => Country::honduras(),
2585            "hkg" => Country::hong_kong(),
2586            "hun" => Country::hungary(),
2587            "isl" => Country::iceland(),
2588            "ind" => Country::india(),
2589            "idn" => Country::indonesia(),
2590            "irq" => Country::iraq(),
2591            "irl" => Country::ireland(),
2592            "irn" => Country::islamic_republic_of_iran(),
2593            "imn" => Country::isle_of_man(),
2594            "isr" => Country::israel(),
2595            "ita" => Country::italy(),
2596            "jam" => Country::jamaica(),
2597            "jpn" => Country::japan(),
2598            "jey" => Country::jersey(),
2599            "jor" => Country::jordan(),
2600            "kaz" => Country::kazakhstan(),
2601            "ken" => Country::kenya(),
2602            "xkx" => Country::kosovo(),
2603            "kir" => Country::kiribati(),
2604            "kwt" => Country::kuwait(),
2605            "kgz" => Country::kyrgyzstan(),
2606            "lva" => Country::latvia(),
2607            "lbn" => Country::lebanon(),
2608            "lso" => Country::lesotho(),
2609            "lbr" => Country::liberia(),
2610            "lby" => Country::libya(),
2611            "lie" => Country::liechtenstein(),
2612            "ltu" => Country::lithuania(),
2613            "lux" => Country::luxembourg(),
2614            "mac" => Country::macao(),
2615            "mdg" => Country::madagascar(),
2616            "mwi" => Country::malawi(),
2617            "mys" => Country::malaysia(),
2618            "mdv" => Country::maldives(),
2619            "mli" => Country::mali(),
2620            "mlt" => Country::malta(),
2621            "mtq" => Country::martinique(),
2622            "mrt" => Country::mauritania(),
2623            "mus" => Country::mauritius(),
2624            "myt" => Country::mayotte(),
2625            "mex" => Country::mexico(),
2626            "mco" => Country::monaco(),
2627            "mng" => Country::mongolia(),
2628            "mne" => Country::montenegro(),
2629            "msr" => Country::montserrat(),
2630            "mar" => Country::morocco(),
2631            "moz" => Country::mozambique(),
2632            "mmr" => Country::myanmar(),
2633            "nam" => Country::namibia(),
2634            "nru" => Country::nauru(),
2635            "npl" => Country::nepal(),
2636            "ncl" => Country::new_caledonia(),
2637            "nzl" => Country::new_zealand(),
2638            "nic" => Country::nicaragua(),
2639            "nga" => Country::nigeria(),
2640            "niu" => Country::niue(),
2641            "nfk" => Country::norfolk_island(),
2642            "nor" => Country::norway(),
2643            "omn" => Country::oman(),
2644            "pak" => Country::pakistan(),
2645            "plw" => Country::palau(),
2646            "pan" => Country::panama(),
2647            "png" => Country::papua_new_guinea(),
2648            "pry" => Country::paraguay(),
2649            "per" => Country::peru(),
2650            "pcn" => Country::pitcairn(),
2651            "pol" => Country::poland(),
2652            "prt" => Country::portugal(),
2653            "pri" => Country::puerto_rico(),
2654            "qat" => Country::qatar(),
2655            "mkd" => Country::republic_of_north_macedonia(),
2656            "reu" => Country::reunion(),
2657            "rou" => Country::romania(),
2658            "rwa" => Country::rwanda(),
2659            "blm" => Country::saint_barthelemy(),
2660            "kna" => Country::saint_kitts_and_nevis(),
2661            "lca" => Country::saint_lucia(),
2662            "spm" => Country::saint_pierre_and_miquelon(),
2663            "vct" => Country::saint_vincent_and_the_grenadines(),
2664            "wsm" => Country::samoa(),
2665            "smr" => Country::san_marino(),
2666            "stp" => Country::sao_tome_and_principe(),
2667            "sau" => Country::saudi_arabia(),
2668            "sen" => Country::senegal(),
2669            "srb" => Country::serbia(),
2670            "syc" => Country::seychelles(),
2671            "sle" => Country::sierra_leone(),
2672            "sgp" => Country::singapore(),
2673            "svk" => Country::slovakia(),
2674            "svn" => Country::slovenia(),
2675            "slb" => Country::solomon_islands(),
2676            "som" => Country::somalia(),
2677            "zaf" => Country::south_africa(),
2678            "sgs" => Country::south_georgia_and_the_south_sandwich_islands(),
2679            "ssd" => Country::south_sudan(),
2680            "esp" => Country::spain(),
2681            "lka" => Country::sri_lanka(),
2682            "pse" => Country::state_of_palestine(),
2683            "sur" => Country::suriname(),
2684            "sjm" => Country::svalbard_and_jan_mayen(),
2685            "swe" => Country::sweden(),
2686            "che" => Country::switzerland(),
2687            "syr" => Country::syrian_arab_republic(),
2688            "twn" => Country::taiwan(),
2689            "tjk" => Country::tajikistan(),
2690            "tha" => Country::thailand(),
2691            "bhs" => Country::the_bahamas(),
2692            "cym" => Country::the_cayman_islands(),
2693            "caf" => Country::the_central_african_republic(),
2694            "cck" => Country::the_cocos_keeling_islands(),
2695            "com" => Country::the_comoros(),
2696            "cog" => Country::the_congo(),
2697            "cok" => Country::the_cook_islands(),
2698            "prk" => Country::the_democratic_peoples_republic_of_korea(),
2699            "cod" => Country::the_democratic_republic_of_the_congo(),
2700            "dom" => Country::the_dominican_republic(),
2701            "flk" => Country::the_falkland_islands_malvinas(),
2702            "fro" => Country::the_faroe_islands(),
2703            "atf" => Country::the_french_southern_territories(),
2704            "gmb" => Country::the_gambia(),
2705            "vat" => Country::the_holy_see(),
2706            "lao" => Country::the_lao_peoples_democratic_republic(),
2707            "mhl" => Country::the_marshall_islands(),
2708            "nld" => Country::the_netherlands(),
2709            "ner" => Country::the_niger(),
2710            "mnp" => Country::the_northern_mariana_islands(),
2711            "phl" => Country::the_philippines(),
2712            "kor" => Country::the_republic_of_korea(),
2713            "mda" => Country::the_republic_of_moldova(),
2714            "rus" => Country::the_russian_federation(),
2715            "sdn" => Country::the_sudan(),
2716            "tca" => Country::the_turks_and_caicos_islands(),
2717            "are" => Country::the_united_arab_emirates(),
2718            "gbr" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2719            "umi" => Country::the_united_states_minor_outlying_islands(),
2720            "usa" => Country::the_united_states_of_america(),
2721            "tls" => Country::timor_leste(),
2722            "tgo" => Country::togo(),
2723            "tkl" => Country::tokelau(),
2724            "ton" => Country::tonga(),
2725            "tto" => Country::trinidad_and_tobago(),
2726            "tun" => Country::tunisia(),
2727            "tur" => Country::turkey(),
2728            "tkm" => Country::turkmenistan(),
2729            "tuv" => Country::tuvalu(),
2730            "vir" => Country::us_virgin_islands(),
2731            "uga" => Country::uganda(),
2732            "ukr" => Country::ukraine(),
2733            "tza" => Country::united_republic_of_tanzania(),
2734            "ury" => Country::uruguay(),
2735            "uzb" => Country::uzbekistan(),
2736            "vut" => Country::vanuatu(),
2737            "vnm" => Country::vietnam(),
2738            "wlf" => Country::wallis_and_futuna(),
2739            "esh" => Country::western_sahara(),
2740            "yem" => Country::yemen(),
2741            "zmb" => Country::zambia(),
2742            "zwe" => Country::zimbabwe(),
2743        };
2744        lookup_ascii_lowercase(&ALPHA3, alpha3.as_ref())
2745            .copied()
2746            .ok_or("invalid alpha3")
2747    }
2748
2749    /// Given a country alias, return a country or an error if
2750    /// the parameter doesn't match any country
2751    ///
2752    /// The alias is any value in the `aliases` field for a country.
2753    /// For example, "america" would return `the_united_states_of_america`
2754    /// This is case-insensitive.
2755    ///
2756    /// ```
2757    /// use celes::Country;
2758    ///
2759    /// let res = Country::from_alias("u");
2760    /// assert!(res.is_err());
2761    ///
2762    /// let res = Country::from_alias("us");
2763    /// assert!(res.is_err());
2764    ///
2765    /// let res = Country::from_alias("america");
2766    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2767    ///
2768    /// let res = Country::from_alias("russia");
2769    /// assert_eq!(Country::the_russian_federation(), res.unwrap());
2770    ///
2771    /// let res = Country::from_alias("england");
2772    /// assert_eq!(Country::the_united_kingdom_of_great_britain_and_northern_ireland(), res.unwrap());
2773    /// ```
2774    pub fn from_alias<A: AsRef<str>>(alias: A) -> Result<Self, &'static str> {
2775        static ALIASES: Map<&'static str, Country> = phf_map! {
2776            "samoa" => Country::american_samoa(),
2777            "sthelena" => Country::ascension_and_tristan_da_cunha_saint_helena(),
2778            "sainthelena" => Country::ascension_and_tristan_da_cunha_saint_helena(),
2779            "venezuela" => Country::bolivarian_republic_of_venezuela(),
2780            "bosnia" => Country::bosnia_and_herzegovina(),
2781            "herzegovina" => Country::bosnia_and_herzegovina(),
2782            "brunei" => Country::brunei_darussalam(),
2783            "burkina" => Country::burkina_faso(),
2784            "stmaarten" => Country::dutch_part_sint_maarten(),
2785            "saintmaarten" => Country::dutch_part_sint_maarten(),
2786            "micronesia" => Country::federated_states_of_micronesia(),
2787            "stmartin" => Country::french_part_saint_martin(),
2788            "saintmartin" => Country::french_part_saint_martin(),
2789            "heardisland" => Country::heard_island_and_mc_donald_islands(),
2790            "mcdonaldislands" => Country::heard_island_and_mc_donald_islands(),
2791            "iran" => Country::islamic_republic_of_iran(),
2792            "macedonia" => Country::republic_of_north_macedonia(),
2793            "stbarthelemy" => Country::saint_barthelemy(),
2794            "stkitts" => Country::saint_kitts_and_nevis(),
2795            "stlucia" => Country::saint_lucia(),
2796            "stpierre" => Country::saint_pierre_and_miquelon(),
2797            "saintpierre" => Country::saint_pierre_and_miquelon(),
2798            "stvincent" => Country::saint_vincent_and_the_grenadines(),
2799            "saintvincent" => Country::saint_vincent_and_the_grenadines(),
2800            "saotome" => Country::sao_tome_and_principe(),
2801            "southgeorgia" => Country::south_georgia_and_the_south_sandwich_islands(),
2802            "southsandwichislands" => Country::south_georgia_and_the_south_sandwich_islands(),
2803            "palestine" => Country::state_of_palestine(),
2804            "taiwan" => Country::taiwan(),
2805            "bahamas" => Country::the_bahamas(),
2806            "caymanislands" => Country::the_cayman_islands(),
2807            "centralafricanrepublic" => Country::the_central_african_republic(),
2808            "cocosislands" => Country::the_cocos_keeling_islands(),
2809            "keelingislands" => Country::the_cocos_keeling_islands(),
2810            "comoros" => Country::the_comoros(),
2811            "congo" => Country::the_congo(),
2812            "cookislands" => Country::the_cook_islands(),
2813            "czechrepublic" => Country::czechia(),
2814            "northkorea" => Country::the_democratic_peoples_republic_of_korea(),
2815            "democraticpeoplesrepublicofkorea" => Country::the_democratic_peoples_republic_of_korea(),
2816            "democraticrepublicofthecongo" => Country::the_democratic_republic_of_the_congo(),
2817            "dominicanrepublic" => Country::the_dominican_republic(),
2818            "easttimor" => Country::timor_leste(),
2819            "malvinas" => Country::the_falkland_islands_malvinas(),
2820            "falklandislands" => Country::the_falkland_islands_malvinas(),
2821            "faroeislands" => Country::the_faroe_islands(),
2822            "frenchsouthernterritories" => Country::the_french_southern_territories(),
2823            "gambia" => Country::the_gambia(),
2824            "holysee" => Country::the_holy_see(),
2825            "laopeoplesdemocraticrepublic" => Country::the_lao_peoples_democratic_republic(),
2826            "marshallislands" => Country::the_marshall_islands(),
2827            "netherlands" => Country::the_netherlands(),
2828            "holland" => Country::the_netherlands(),
2829            "niger" => Country::the_niger(),
2830            "northernmarianaislands" => Country::the_northern_mariana_islands(),
2831            "philippines" => Country::the_philippines(),
2832            "southkorea" => Country::the_republic_of_korea(),
2833            "republicofkorea" => Country::the_republic_of_korea(),
2834            "moldova" => Country::the_republic_of_moldova(),
2835            "republicofmoldova" => Country::the_republic_of_moldova(),
2836            "russia" => Country::the_russian_federation(),
2837            "russianfederation" => Country::the_russian_federation(),
2838            "sudan" => Country::the_sudan(),
2839            "turksandcaicosislands" => Country::the_turks_and_caicos_islands(),
2840            "unitedarabemirates" => Country::the_united_arab_emirates(),
2841            "england" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2842            "scotland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2843            "greatbritain" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2844            "unitedkingdom" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2845            "northernireland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2846            "unitedkingdomofgreatbritain" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2847            "unitedkingdomofgreatbritainandnorthernireland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
2848            "unitedstatesminoroutlyingislands" => Country::the_united_states_minor_outlying_islands(),
2849            "america" => Country::the_united_states_of_america(),
2850            "unitedstates" => Country::the_united_states_of_america(),
2851            "unitedstatesofamerica" => Country::the_united_states_of_america(),
2852            "trinidad" => Country::trinidad_and_tobago(),
2853            "tobago" => Country::trinidad_and_tobago(),
2854            "tanzania" => Country::united_republic_of_tanzania(),
2855            "türkiye" => Country::turkey(),
2856            "turkey" => Country::turkey(),
2857        };
2858        lookup_ascii_lowercase(&ALIASES, alias.as_ref())
2859            .copied()
2860            .ok_or("invalid alias")
2861    }
2862
2863    /// Given the country name, return a country or an error if
2864    /// the parameter doesn't match any country.  This is case-insensitive.
2865    ///
2866    /// For example, Albania, Algeria, Brazil would return the country
2867    /// struct that represents those countries.
2868    ///
2869    /// ```
2870    /// use celes::Country;
2871    ///
2872    /// let res = Country::from_name("russianfederation");
2873    /// assert!(res.is_err());
2874    ///
2875    /// let res = Country::from_name("unitedstatesofamerica");
2876    /// assert!(res.is_err());
2877    ///
2878    /// let res = Country::from_name("Albania");
2879    /// assert_eq!(Country::albania(), res.unwrap());
2880    ///
2881    /// let res = Country::from_name("theunitedstatesofamerica");
2882    /// assert_eq!(Country::the_united_states_of_america(), res.unwrap());
2883    ///
2884    /// let res = Country::from_name("therussianfederation");
2885    /// assert_eq!(Country::the_russian_federation(), res.unwrap());
2886    ///
2887    /// let res = Country::from_name("theunitedkingdomofgreatbritainandnorthernireland");
2888    /// assert_eq!(Country::the_united_kingdom_of_great_britain_and_northern_ireland(), res.unwrap());
2889    /// ```
2890    pub fn from_name<A: AsRef<str>>(name: A) -> Result<Self, &'static str> {
2891        static NAMES: Map<&'static str, Country> = phf_map! {
2892            "afghanistan" => Country::afghanistan(),
2893            "alandislands" => Country::aland_islands(),
2894            "albania" => Country::albania(),
2895            "algeria" => Country::algeria(),
2896            "americansamoa" => Country::american_samoa(),
2897            "andorra" => Country::andorra(),
2898            "angola" => Country::angola(),
2899            "anguilla" => Country::anguilla(),
2900            "antarctica" => Country::antarctica(),
2901            "antiguaandbarbuda" => Country::antigua_and_barbuda(),
2902            "argentina" => Country::argentina(),
2903            "armenia" => Country::armenia(),
2904            "aruba" => Country::aruba(),
2905            "ascensionandtristandacunhasainthelena" => Country::ascension_and_tristan_da_cunha_saint_helena(),
2906            "australia" => Country::australia(),
2907            "austria" => Country::austria(),
2908            "azerbaijan" => Country::azerbaijan(),
2909            "bahrain" => Country::bahrain(),
2910            "bangladesh" => Country::bangladesh(),
2911            "barbados" => Country::barbados(),
2912            "belarus" => Country::belarus(),
2913            "belgium" => Country::belgium(),
2914            "belize" => Country::belize(),
2915            "benin" => Country::benin(),
2916            "bermuda" => Country::bermuda(),
2917            "bhutan" => Country::bhutan(),
2918            "bolivarianrepublicofvenezuela" => Country::bolivarian_republic_of_venezuela(),
2919            "bolivia" => Country::bolivia(),
2920            "bonaire" => Country::bonaire(),
2921            "bosniaandherzegovina" => Country::bosnia_and_herzegovina(),
2922            "botswana" => Country::botswana(),
2923            "bouvetisland" => Country::bouvet_island(),
2924            "brazil" => Country::brazil(),
2925            "britishindianoceanterritory" => Country::british_indian_ocean_territory(),
2926            "britishvirginislands" => Country::british_virgin_islands(),
2927            "bruneidarussalam" => Country::brunei_darussalam(),
2928            "bulgaria" => Country::bulgaria(),
2929            "burkinafaso" => Country::burkina_faso(),
2930            "burundi" => Country::burundi(),
2931            "caboverde" => Country::cabo_verde(),
2932            "cambodia" => Country::cambodia(),
2933            "cameroon" => Country::cameroon(),
2934            "canada" => Country::canada(),
2935            "chad" => Country::chad(),
2936            "chile" => Country::chile(),
2937            "china" => Country::china(),
2938            "christmasisland" => Country::christmas_island(),
2939            "colombia" => Country::colombia(),
2940            "costarica" => Country::costa_rica(),
2941            "cotedivoire" => Country::coted_ivoire(),
2942            "croatia" => Country::croatia(),
2943            "cuba" => Country::cuba(),
2944            "curacao" => Country::curacao(),
2945            "cyprus" => Country::cyprus(),
2946            "czechia" => Country::czechia(),
2947            "denmark" => Country::denmark(),
2948            "djibouti" => Country::djibouti(),
2949            "dominica" => Country::dominica(),
2950            "dutchpartsintmaarten" => Country::dutch_part_sint_maarten(),
2951            "ecuador" => Country::ecuador(),
2952            "egypt" => Country::egypt(),
2953            "elsalvador" => Country::el_salvador(),
2954            "equatorialguinea" => Country::equatorial_guinea(),
2955            "eritrea" => Country::eritrea(),
2956            "estonia" => Country::estonia(),
2957            "eswatini" => Country::eswatini(),
2958            "ethiopia" => Country::ethiopia(),
2959            "federatedstatesofmicronesia" => Country::federated_states_of_micronesia(),
2960            "fiji" => Country::fiji(),
2961            "finland" => Country::finland(),
2962            "france" => Country::france(),
2963            "frenchguiana" => Country::french_guiana(),
2964            "frenchpartsaintmartin" => Country::french_part_saint_martin(),
2965            "frenchpolynesia" => Country::french_polynesia(),
2966            "gabon" => Country::gabon(),
2967            "georgia" => Country::georgia(),
2968            "germany" => Country::germany(),
2969            "ghana" => Country::ghana(),
2970            "gibraltar" => Country::gibraltar(),
2971            "greece" => Country::greece(),
2972            "greenland" => Country::greenland(),
2973            "grenada" => Country::grenada(),
2974            "guadeloupe" => Country::guadeloupe(),
2975            "guam" => Country::guam(),
2976            "guatemala" => Country::guatemala(),
2977            "guernsey" => Country::guernsey(),
2978            "guinea" => Country::guinea(),
2979            "guineabissau" => Country::guinea_bissau(),
2980            "guyana" => Country::guyana(),
2981            "haiti" => Country::haiti(),
2982            "heardislandandmcdonaldislands" => Country::heard_island_and_mc_donald_islands(),
2983            "honduras" => Country::honduras(),
2984            "hongkong" => Country::hong_kong(),
2985            "hungary" => Country::hungary(),
2986            "iceland" => Country::iceland(),
2987            "india" => Country::india(),
2988            "indonesia" => Country::indonesia(),
2989            "iraq" => Country::iraq(),
2990            "ireland" => Country::ireland(),
2991            "islamicrepublicofiran" => Country::islamic_republic_of_iran(),
2992            "isleofman" => Country::isle_of_man(),
2993            "israel" => Country::israel(),
2994            "italy" => Country::italy(),
2995            "jamaica" => Country::jamaica(),
2996            "japan" => Country::japan(),
2997            "jersey" => Country::jersey(),
2998            "jordan" => Country::jordan(),
2999            "kazakhstan" => Country::kazakhstan(),
3000            "kenya" => Country::kenya(),
3001            "kiribati" => Country::kiribati(),
3002            "kosovo" => Country::kosovo(),
3003            "kuwait" => Country::kuwait(),
3004            "kyrgyzstan" => Country::kyrgyzstan(),
3005            "latvia" => Country::latvia(),
3006            "lebanon" => Country::lebanon(),
3007            "lesotho" => Country::lesotho(),
3008            "liberia" => Country::liberia(),
3009            "libya" => Country::libya(),
3010            "liechtenstein" => Country::liechtenstein(),
3011            "lithuania" => Country::lithuania(),
3012            "luxembourg" => Country::luxembourg(),
3013            "macao" => Country::macao(),
3014            "madagascar" => Country::madagascar(),
3015            "malawi" => Country::malawi(),
3016            "malaysia" => Country::malaysia(),
3017            "maldives" => Country::maldives(),
3018            "mali" => Country::mali(),
3019            "malta" => Country::malta(),
3020            "martinique" => Country::martinique(),
3021            "mauritania" => Country::mauritania(),
3022            "mauritius" => Country::mauritius(),
3023            "mayotte" => Country::mayotte(),
3024            "mexico" => Country::mexico(),
3025            "monaco" => Country::monaco(),
3026            "mongolia" => Country::mongolia(),
3027            "montenegro" => Country::montenegro(),
3028            "montserrat" => Country::montserrat(),
3029            "morocco" => Country::morocco(),
3030            "mozambique" => Country::mozambique(),
3031            "myanmar" => Country::myanmar(),
3032            "namibia" => Country::namibia(),
3033            "nauru" => Country::nauru(),
3034            "nepal" => Country::nepal(),
3035            "newcaledonia" => Country::new_caledonia(),
3036            "newzealand" => Country::new_zealand(),
3037            "nicaragua" => Country::nicaragua(),
3038            "nigeria" => Country::nigeria(),
3039            "niue" => Country::niue(),
3040            "norfolkisland" => Country::norfolk_island(),
3041            "norway" => Country::norway(),
3042            "oman" => Country::oman(),
3043            "pakistan" => Country::pakistan(),
3044            "palau" => Country::palau(),
3045            "panama" => Country::panama(),
3046            "papuanewguinea" => Country::papua_new_guinea(),
3047            "paraguay" => Country::paraguay(),
3048            "peru" => Country::peru(),
3049            "pitcairn" => Country::pitcairn(),
3050            "poland" => Country::poland(),
3051            "portugal" => Country::portugal(),
3052            "puertorico" => Country::puerto_rico(),
3053            "qatar" => Country::qatar(),
3054            "republicofnorthmacedonia" => Country::republic_of_north_macedonia(),
3055            "reunion" => Country::reunion(),
3056            "romania" => Country::romania(),
3057            "rwanda" => Country::rwanda(),
3058            "saintbarthelemy" => Country::saint_barthelemy(),
3059            "saintkittsandnevis" => Country::saint_kitts_and_nevis(),
3060            "saintlucia" => Country::saint_lucia(),
3061            "saintpierreandmiquelon" => Country::saint_pierre_and_miquelon(),
3062            "saintvincentandthegrenadines" => Country::saint_vincent_and_the_grenadines(),
3063            "samoa" => Country::samoa(),
3064            "sanmarino" => Country::san_marino(),
3065            "saotomeandprincipe" => Country::sao_tome_and_principe(),
3066            "saudiarabia" => Country::saudi_arabia(),
3067            "senegal" => Country::senegal(),
3068            "serbia" => Country::serbia(),
3069            "seychelles" => Country::seychelles(),
3070            "sierraleone" => Country::sierra_leone(),
3071            "singapore" => Country::singapore(),
3072            "slovakia" => Country::slovakia(),
3073            "slovenia" => Country::slovenia(),
3074            "solomonislands" => Country::solomon_islands(),
3075            "somalia" => Country::somalia(),
3076            "southafrica" => Country::south_africa(),
3077            "southgeorgiaandthesouthsandwichislands" => Country::south_georgia_and_the_south_sandwich_islands(),
3078            "southsudan" => Country::south_sudan(),
3079            "spain" => Country::spain(),
3080            "srilanka" => Country::sri_lanka(),
3081            "stateofpalestine" => Country::state_of_palestine(),
3082            "suriname" => Country::suriname(),
3083            "svalbardandjanmayen" => Country::svalbard_and_jan_mayen(),
3084            "sweden" => Country::sweden(),
3085            "switzerland" => Country::switzerland(),
3086            "syrianarabrepublic" => Country::syrian_arab_republic(),
3087            "taiwan,republicofchina" => Country::taiwan(),
3088            "tajikistan" => Country::tajikistan(),
3089            "thailand" => Country::thailand(),
3090            "thebahamas" => Country::the_bahamas(),
3091            "thecaymanislands" => Country::the_cayman_islands(),
3092            "thecentralafricanrepublic" => Country::the_central_african_republic(),
3093            "thecocoskeelingislands" => Country::the_cocos_keeling_islands(),
3094            "thecomoros" => Country::the_comoros(),
3095            "thecongo" => Country::the_congo(),
3096            "thecookislands" => Country::the_cook_islands(),
3097            "thedemocraticpeoplesrepublicofkorea" => Country::the_democratic_peoples_republic_of_korea(),
3098            "thedemocraticrepublicofthecongo" => Country::the_democratic_republic_of_the_congo(),
3099            "thedominicanrepublic" => Country::the_dominican_republic(),
3100            "thefalklandislandsmalvinas" => Country::the_falkland_islands_malvinas(),
3101            "thefaroeislands" => Country::the_faroe_islands(),
3102            "thefrenchsouthernterritories" => Country::the_french_southern_territories(),
3103            "thegambia" => Country::the_gambia(),
3104            "theholysee" => Country::the_holy_see(),
3105            "thelaopeoplesdemocraticrepublic" => Country::the_lao_peoples_democratic_republic(),
3106            "themarshallislands" => Country::the_marshall_islands(),
3107            "thenetherlands" => Country::the_netherlands(),
3108            "theniger" => Country::the_niger(),
3109            "thenorthernmarianaislands" => Country::the_northern_mariana_islands(),
3110            "thephilippines" => Country::the_philippines(),
3111            "therepublicofkorea" => Country::the_republic_of_korea(),
3112            "therepublicofmoldova" => Country::the_republic_of_moldova(),
3113            "therussianfederation" => Country::the_russian_federation(),
3114            "thesudan" => Country::the_sudan(),
3115            "theturksandcaicosislands" => Country::the_turks_and_caicos_islands(),
3116            "theunitedarabemirates" => Country::the_united_arab_emirates(),
3117            "theunitedkingdomofgreatbritainandnorthernireland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
3118            "theunitedstatesminoroutlyingislands" => Country::the_united_states_minor_outlying_islands(),
3119            "theunitedstatesofamerica" => Country::the_united_states_of_america(),
3120            "timorleste" => Country::timor_leste(),
3121            "easttimor" => Country::timor_leste(),
3122            "togo" => Country::togo(),
3123            "tokelau" => Country::tokelau(),
3124            "tonga" => Country::tonga(),
3125            "trinidadandtobago" => Country::trinidad_and_tobago(),
3126            "tunisia" => Country::tunisia(),
3127            "turkey" => Country::turkey(),
3128            "türkiye" => Country::turkey(),
3129            "turkmenistan" => Country::turkmenistan(),
3130            "tuvalu" => Country::tuvalu(),
3131            "usvirginislands" => Country::us_virgin_islands(),
3132            "uganda" => Country::uganda(),
3133            "ukraine" => Country::ukraine(),
3134            "unitedrepublicoftanzania" => Country::united_republic_of_tanzania(),
3135            "uruguay" => Country::uruguay(),
3136            "uzbekistan" => Country::uzbekistan(),
3137            "vanuatu" => Country::vanuatu(),
3138            "vietnam" => Country::vietnam(),
3139            "wallisandfutuna" => Country::wallis_and_futuna(),
3140            "westernsahara" => Country::western_sahara(),
3141            "yemen" => Country::yemen(),
3142            "zambia" => Country::zambia(),
3143            "zimbabwe" => Country::zimbabwe(),
3144        };
3145        lookup_ascii_lowercase(&NAMES, name.as_ref())
3146            .copied()
3147            .ok_or("unknown value")
3148    }
3149}
3150
3151impl FromStr for Country {
3152    type Err = &'static str;
3153
3154    fn from_str(code: &str) -> Result<Self, &'static str> {
3155        static CODES: Map<&'static str, Country> = phf_map! {
3156            "afghanistan" => Country::afghanistan(),
3157            "004" => Country::afghanistan(),
3158            "af" => Country::afghanistan(),
3159            "afg" => Country::afghanistan(),
3160            "alandislands" => Country::aland_islands(),
3161            "aland_islands" => Country::aland_islands(),
3162            "248" => Country::aland_islands(),
3163            "ax" => Country::aland_islands(),
3164            "ala" => Country::aland_islands(),
3165            "albania" => Country::albania(),
3166            "008" => Country::albania(),
3167            "al" => Country::albania(),
3168            "alb" => Country::albania(),
3169            "algeria" => Country::algeria(),
3170            "012" => Country::algeria(),
3171            "dz" => Country::algeria(),
3172            "dza" => Country::algeria(),
3173            "americansamoa" => Country::american_samoa(),
3174            "american_samoa" => Country::american_samoa(),
3175            "016" => Country::american_samoa(),
3176            "as" => Country::american_samoa(),
3177            "asm" => Country::american_samoa(),
3178            "andorra" => Country::andorra(),
3179            "020" => Country::andorra(),
3180            "ad" => Country::andorra(),
3181            "and" => Country::andorra(),
3182            "angola" => Country::angola(),
3183            "024" => Country::angola(),
3184            "ao" => Country::angola(),
3185            "ago" => Country::angola(),
3186            "anguilla" => Country::anguilla(),
3187            "660" => Country::anguilla(),
3188            "ai" => Country::anguilla(),
3189            "aia" => Country::anguilla(),
3190            "antarctica" => Country::antarctica(),
3191            "010" => Country::antarctica(),
3192            "aq" => Country::antarctica(),
3193            "ata" => Country::antarctica(),
3194            "antiguaandbarbuda" => Country::antigua_and_barbuda(),
3195            "antigua_and_barbuda" => Country::antigua_and_barbuda(),
3196            "028" => Country::antigua_and_barbuda(),
3197            "ag" => Country::antigua_and_barbuda(),
3198            "atg" => Country::antigua_and_barbuda(),
3199            "argentina" => Country::argentina(),
3200            "032" => Country::argentina(),
3201            "ar" => Country::argentina(),
3202            "arg" => Country::argentina(),
3203            "armenia" => Country::armenia(),
3204            "051" => Country::armenia(),
3205            "am" => Country::armenia(),
3206            "arm" => Country::armenia(),
3207            "aruba" => Country::aruba(),
3208            "533" => Country::aruba(),
3209            "aw" => Country::aruba(),
3210            "abw" => Country::aruba(),
3211            "ascensionandtristandacunhasainthelena" => Country::ascension_and_tristan_da_cunha_saint_helena(),
3212            "ascension_and_tristan_da_cunha_saint_helena" => Country::ascension_and_tristan_da_cunha_saint_helena(),
3213            "654" => Country::ascension_and_tristan_da_cunha_saint_helena(),
3214            "sh" => Country::ascension_and_tristan_da_cunha_saint_helena(),
3215            "shn" => Country::ascension_and_tristan_da_cunha_saint_helena(),
3216            "sthelena" => Country::ascension_and_tristan_da_cunha_saint_helena(),
3217            "sainthelena" => Country::ascension_and_tristan_da_cunha_saint_helena(),
3218            "australia" => Country::australia(),
3219            "036" => Country::australia(),
3220            "au" => Country::australia(),
3221            "aus" => Country::australia(),
3222            "austria" => Country::austria(),
3223            "040" => Country::austria(),
3224            "at" => Country::austria(),
3225            "aut" => Country::austria(),
3226            "azerbaijan" => Country::azerbaijan(),
3227            "031" => Country::azerbaijan(),
3228            "az" => Country::azerbaijan(),
3229            "aze" => Country::azerbaijan(),
3230            "bahrain" => Country::bahrain(),
3231            "048" => Country::bahrain(),
3232            "bh" => Country::bahrain(),
3233            "bhr" => Country::bahrain(),
3234            "bangladesh" => Country::bangladesh(),
3235            "050" => Country::bangladesh(),
3236            "bd" => Country::bangladesh(),
3237            "bgd" => Country::bangladesh(),
3238            "barbados" => Country::barbados(),
3239            "052" => Country::barbados(),
3240            "bb" => Country::barbados(),
3241            "brb" => Country::barbados(),
3242            "belarus" => Country::belarus(),
3243            "112" => Country::belarus(),
3244            "by" => Country::belarus(),
3245            "blr" => Country::belarus(),
3246            "belgium" => Country::belgium(),
3247            "056" => Country::belgium(),
3248            "be" => Country::belgium(),
3249            "bel" => Country::belgium(),
3250            "belize" => Country::belize(),
3251            "084" => Country::belize(),
3252            "bz" => Country::belize(),
3253            "blz" => Country::belize(),
3254            "benin" => Country::benin(),
3255            "204" => Country::benin(),
3256            "bj" => Country::benin(),
3257            "ben" => Country::benin(),
3258            "bermuda" => Country::bermuda(),
3259            "060" => Country::bermuda(),
3260            "bm" => Country::bermuda(),
3261            "bmu" => Country::bermuda(),
3262            "bhutan" => Country::bhutan(),
3263            "064" => Country::bhutan(),
3264            "bt" => Country::bhutan(),
3265            "btn" => Country::bhutan(),
3266            "bolivarianrepublicofvenezuela" => Country::bolivarian_republic_of_venezuela(),
3267            "bolivarian_republic_of_venezuela" => Country::bolivarian_republic_of_venezuela(),
3268            "862" => Country::bolivarian_republic_of_venezuela(),
3269            "ve" => Country::bolivarian_republic_of_venezuela(),
3270            "ven" => Country::bolivarian_republic_of_venezuela(),
3271            "venezuela" => Country::bolivarian_republic_of_venezuela(),
3272            "bolivia" => Country::bolivia(),
3273            "068" => Country::bolivia(),
3274            "bo" => Country::bolivia(),
3275            "bol" => Country::bolivia(),
3276            "bonaire" => Country::bonaire(),
3277            "535" => Country::bonaire(),
3278            "bq" => Country::bonaire(),
3279            "bes" => Country::bonaire(),
3280            "bosniaandherzegovina" => Country::bosnia_and_herzegovina(),
3281            "bosnia_and_herzegovina" => Country::bosnia_and_herzegovina(),
3282            "070" => Country::bosnia_and_herzegovina(),
3283            "ba" => Country::bosnia_and_herzegovina(),
3284            "bih" => Country::bosnia_and_herzegovina(),
3285            "bosnia" => Country::bosnia_and_herzegovina(),
3286            "herzegovina" => Country::bosnia_and_herzegovina(),
3287            "botswana" => Country::botswana(),
3288            "072" => Country::botswana(),
3289            "bw" => Country::botswana(),
3290            "bwa" => Country::botswana(),
3291            "bouvetisland" => Country::bouvet_island(),
3292            "bouvet_island" => Country::bouvet_island(),
3293            "074" => Country::bouvet_island(),
3294            "bv" => Country::bouvet_island(),
3295            "bvt" => Country::bouvet_island(),
3296            "brazil" => Country::brazil(),
3297            "076" => Country::brazil(),
3298            "br" => Country::brazil(),
3299            "bra" => Country::brazil(),
3300            "britishindianoceanterritory" => Country::british_indian_ocean_territory(),
3301            "british_indian_ocean_territory" => Country::british_indian_ocean_territory(),
3302            "086" => Country::british_indian_ocean_territory(),
3303            "io" => Country::british_indian_ocean_territory(),
3304            "iot" => Country::british_indian_ocean_territory(),
3305            "britishvirginislands" => Country::british_virgin_islands(),
3306            "british_virgin_islands" => Country::british_virgin_islands(),
3307            "092" => Country::british_virgin_islands(),
3308            "vg" => Country::british_virgin_islands(),
3309            "vgb" => Country::british_virgin_islands(),
3310            "bruneidarussalam" => Country::brunei_darussalam(),
3311            "brunei_darussalam" => Country::brunei_darussalam(),
3312            "096" => Country::brunei_darussalam(),
3313            "bn" => Country::brunei_darussalam(),
3314            "brn" => Country::brunei_darussalam(),
3315            "brunei" => Country::brunei_darussalam(),
3316            "bulgaria" => Country::bulgaria(),
3317            "100" => Country::bulgaria(),
3318            "bg" => Country::bulgaria(),
3319            "bgr" => Country::bulgaria(),
3320            "burkinafaso" => Country::burkina_faso(),
3321            "burkina_faso" => Country::burkina_faso(),
3322            "854" => Country::burkina_faso(),
3323            "bf" => Country::burkina_faso(),
3324            "bfa" => Country::burkina_faso(),
3325            "burkina" => Country::burkina_faso(),
3326            "burundi" => Country::burundi(),
3327            "108" => Country::burundi(),
3328            "bi" => Country::burundi(),
3329            "bdi" => Country::burundi(),
3330            "caboverde" => Country::cabo_verde(),
3331            "cabo_verde" => Country::cabo_verde(),
3332            "132" => Country::cabo_verde(),
3333            "cv" => Country::cabo_verde(),
3334            "cpv" => Country::cabo_verde(),
3335            "cambodia" => Country::cambodia(),
3336            "116" => Country::cambodia(),
3337            "kh" => Country::cambodia(),
3338            "khm" => Country::cambodia(),
3339            "cameroon" => Country::cameroon(),
3340            "120" => Country::cameroon(),
3341            "cm" => Country::cameroon(),
3342            "cmr" => Country::cameroon(),
3343            "canada" => Country::canada(),
3344            "124" => Country::canada(),
3345            "ca" => Country::canada(),
3346            "can" => Country::canada(),
3347            "chad" => Country::chad(),
3348            "148" => Country::chad(),
3349            "td" => Country::chad(),
3350            "tcd" => Country::chad(),
3351            "chile" => Country::chile(),
3352            "152" => Country::chile(),
3353            "cl" => Country::chile(),
3354            "chl" => Country::chile(),
3355            "china" => Country::china(),
3356            "156" => Country::china(),
3357            "cn" => Country::china(),
3358            "chn" => Country::china(),
3359            "christmasisland" => Country::christmas_island(),
3360            "christmas_island" => Country::christmas_island(),
3361            "162" => Country::christmas_island(),
3362            "cx" => Country::christmas_island(),
3363            "cxr" => Country::christmas_island(),
3364            "colombia" => Country::colombia(),
3365            "170" => Country::colombia(),
3366            "co" => Country::colombia(),
3367            "col" => Country::colombia(),
3368            "costarica" => Country::costa_rica(),
3369            "costa_rica" => Country::costa_rica(),
3370            "188" => Country::costa_rica(),
3371            "cr" => Country::costa_rica(),
3372            "cri" => Country::costa_rica(),
3373            "cotedivoire" => Country::coted_ivoire(),
3374            "coted_ivoire" => Country::coted_ivoire(),
3375            "384" => Country::coted_ivoire(),
3376            "ci" => Country::coted_ivoire(),
3377            "civ" => Country::coted_ivoire(),
3378            "croatia" => Country::croatia(),
3379            "191" => Country::croatia(),
3380            "hr" => Country::croatia(),
3381            "hrv" => Country::croatia(),
3382            "cuba" => Country::cuba(),
3383            "192" => Country::cuba(),
3384            "cu" => Country::cuba(),
3385            "cub" => Country::cuba(),
3386            "curacao" => Country::curacao(),
3387            "531" => Country::curacao(),
3388            "cw" => Country::curacao(),
3389            "cuw" => Country::curacao(),
3390            "cyprus" => Country::cyprus(),
3391            "196" => Country::cyprus(),
3392            "cy" => Country::cyprus(),
3393            "cyp" => Country::cyprus(),
3394            "czechia" => Country::czechia(),
3395            "czechrepublic" => Country::czechia(),
3396            "203" => Country::czechia(),
3397            "cz" => Country::czechia(),
3398            "cze" => Country::czechia(),
3399            "denmark" => Country::denmark(),
3400            "208" => Country::denmark(),
3401            "dk" => Country::denmark(),
3402            "dnk" => Country::denmark(),
3403            "djibouti" => Country::djibouti(),
3404            "262" => Country::djibouti(),
3405            "dj" => Country::djibouti(),
3406            "dji" => Country::djibouti(),
3407            "dominica" => Country::dominica(),
3408            "212" => Country::dominica(),
3409            "dm" => Country::dominica(),
3410            "dma" => Country::dominica(),
3411            "dutchpartsintmaarten" => Country::dutch_part_sint_maarten(),
3412            "dutch_part_sint_maarten" => Country::dutch_part_sint_maarten(),
3413            "534" => Country::dutch_part_sint_maarten(),
3414            "sx" => Country::dutch_part_sint_maarten(),
3415            "sxm" => Country::dutch_part_sint_maarten(),
3416            "stmaarten" => Country::dutch_part_sint_maarten(),
3417            "sintmaarten" => Country::dutch_part_sint_maarten(),
3418            "ecuador" => Country::ecuador(),
3419            "218" => Country::ecuador(),
3420            "ec" => Country::ecuador(),
3421            "ecu" => Country::ecuador(),
3422            "egypt" => Country::egypt(),
3423            "818" => Country::egypt(),
3424            "eg" => Country::egypt(),
3425            "egy" => Country::egypt(),
3426            "elsalvador" => Country::el_salvador(),
3427            "el_salvador" => Country::el_salvador(),
3428            "222" => Country::el_salvador(),
3429            "sv" => Country::el_salvador(),
3430            "slv" => Country::el_salvador(),
3431            "equatorialguinea" => Country::equatorial_guinea(),
3432            "equatorial_guinea" => Country::equatorial_guinea(),
3433            "226" => Country::equatorial_guinea(),
3434            "gq" => Country::equatorial_guinea(),
3435            "gnq" => Country::equatorial_guinea(),
3436            "eritrea" => Country::eritrea(),
3437            "232" => Country::eritrea(),
3438            "er" => Country::eritrea(),
3439            "eri" => Country::eritrea(),
3440            "estonia" => Country::estonia(),
3441            "233" => Country::estonia(),
3442            "ee" => Country::estonia(),
3443            "est" => Country::estonia(),
3444            "eswatini" => Country::eswatini(),
3445            "748" => Country::eswatini(),
3446            "sz" => Country::eswatini(),
3447            "swz" => Country::eswatini(),
3448            "ethiopia" => Country::ethiopia(),
3449            "231" => Country::ethiopia(),
3450            "et" => Country::ethiopia(),
3451            "eth" => Country::ethiopia(),
3452            "federatedstatesofmicronesia" => Country::federated_states_of_micronesia(),
3453            "federated_states_of_micronesia" => Country::federated_states_of_micronesia(),
3454            "583" => Country::federated_states_of_micronesia(),
3455            "fm" => Country::federated_states_of_micronesia(),
3456            "fsm" => Country::federated_states_of_micronesia(),
3457            "micronesia" => Country::federated_states_of_micronesia(),
3458            "fiji" => Country::fiji(),
3459            "242" => Country::fiji(),
3460            "fj" => Country::fiji(),
3461            "fji" => Country::fiji(),
3462            "finland" => Country::finland(),
3463            "246" => Country::finland(),
3464            "fi" => Country::finland(),
3465            "fin" => Country::finland(),
3466            "france" => Country::france(),
3467            "250" => Country::france(),
3468            "fr" => Country::france(),
3469            "fra" => Country::france(),
3470            "frenchguiana" => Country::french_guiana(),
3471            "french_guiana" => Country::french_guiana(),
3472            "254" => Country::french_guiana(),
3473            "gf" => Country::french_guiana(),
3474            "guf" => Country::french_guiana(),
3475            "frenchpartsaintmartin" => Country::french_part_saint_martin(),
3476            "french_part_saint_martin" => Country::french_part_saint_martin(),
3477            "663" => Country::french_part_saint_martin(),
3478            "mf" => Country::french_part_saint_martin(),
3479            "maf" => Country::french_part_saint_martin(),
3480            "stmartin" => Country::french_part_saint_martin(),
3481            "saintmartin" => Country::french_part_saint_martin(),
3482            "frenchpolynesia" => Country::french_polynesia(),
3483            "258" => Country::french_polynesia(),
3484            "pf" => Country::french_polynesia(),
3485            "pyf" => Country::french_polynesia(),
3486            "gabon" => Country::gabon(),
3487            "266" => Country::gabon(),
3488            "ga" => Country::gabon(),
3489            "gab" => Country::gabon(),
3490            "georgia" => Country::georgia(),
3491            "268" => Country::georgia(),
3492            "ge" => Country::georgia(),
3493            "geo" => Country::georgia(),
3494            "germany" => Country::germany(),
3495            "276" => Country::germany(),
3496            "de" => Country::germany(),
3497            "deu" => Country::germany(),
3498            "ghana" => Country::ghana(),
3499            "288" => Country::ghana(),
3500            "gh" => Country::ghana(),
3501            "gha" => Country::ghana(),
3502            "gibraltar" => Country::gibraltar(),
3503            "292" => Country::gibraltar(),
3504            "gi" => Country::gibraltar(),
3505            "gib" => Country::gibraltar(),
3506            "greece" => Country::greece(),
3507            "300" => Country::greece(),
3508            "gr" => Country::greece(),
3509            "grc" => Country::greece(),
3510            "greenland" => Country::greenland(),
3511            "304" => Country::greenland(),
3512            "gl" => Country::greenland(),
3513            "grl" => Country::greenland(),
3514            "grenada" => Country::grenada(),
3515            "308" => Country::grenada(),
3516            "gd" => Country::grenada(),
3517            "grd" => Country::grenada(),
3518            "guadeloupe" => Country::guadeloupe(),
3519            "312" => Country::guadeloupe(),
3520            "gp" => Country::guadeloupe(),
3521            "glp" => Country::guadeloupe(),
3522            "guam" => Country::guam(),
3523            "316" => Country::guam(),
3524            "gu" => Country::guam(),
3525            "gum" => Country::guam(),
3526            "guatemala" => Country::guatemala(),
3527            "320" => Country::guatemala(),
3528            "gt" => Country::guatemala(),
3529            "gtm" => Country::guatemala(),
3530            "guernsey" => Country::guernsey(),
3531            "831" => Country::guernsey(),
3532            "gg" => Country::guernsey(),
3533            "ggy" => Country::guernsey(),
3534            "guinea" => Country::guinea(),
3535            "324" => Country::guinea(),
3536            "gn" => Country::guinea(),
3537            "gin" => Country::guinea(),
3538            "guineabissau" => Country::guinea_bissau(),
3539            "guinea_bissau" => Country::guinea_bissau(),
3540            "624" => Country::guinea_bissau(),
3541            "gw" => Country::guinea_bissau(),
3542            "gnb" => Country::guinea_bissau(),
3543            "guyana" => Country::guyana(),
3544            "328" => Country::guyana(),
3545            "gy" => Country::guyana(),
3546            "guy" => Country::guyana(),
3547            "haiti" => Country::haiti(),
3548            "332" => Country::haiti(),
3549            "ht" => Country::haiti(),
3550            "hti" => Country::haiti(),
3551            "heardislandandmcdonaldislands" => Country::heard_island_and_mc_donald_islands(),
3552            "heard_island_and_mc_donald_islands" => Country::heard_island_and_mc_donald_islands(),
3553            "334" => Country::heard_island_and_mc_donald_islands(),
3554            "hm" => Country::heard_island_and_mc_donald_islands(),
3555            "hmd" => Country::heard_island_and_mc_donald_islands(),
3556            "heardisland" => Country::heard_island_and_mc_donald_islands(),
3557            "mcdonaldislands" => Country::heard_island_and_mc_donald_islands(),
3558            "honduras" => Country::honduras(),
3559            "340" => Country::honduras(),
3560            "hn" => Country::honduras(),
3561            "hnd" => Country::honduras(),
3562            "hongkong" => Country::hong_kong(),
3563            "hong_kong" => Country::hong_kong(),
3564            "344" => Country::hong_kong(),
3565            "hk" => Country::hong_kong(),
3566            "hkg" => Country::hong_kong(),
3567            "hungary" => Country::hungary(),
3568            "348" => Country::hungary(),
3569            "hu" => Country::hungary(),
3570            "hun" => Country::hungary(),
3571            "iceland" => Country::iceland(),
3572            "352" => Country::iceland(),
3573            "is" => Country::iceland(),
3574            "isl" => Country::iceland(),
3575            "india" => Country::india(),
3576            "356" => Country::india(),
3577            "in" => Country::india(),
3578            "ind" => Country::india(),
3579            "indonesia" => Country::indonesia(),
3580            "360" => Country::indonesia(),
3581            "id" => Country::indonesia(),
3582            "idn" => Country::indonesia(),
3583            "iraq" => Country::iraq(),
3584            "368" => Country::iraq(),
3585            "iq" => Country::iraq(),
3586            "irq" => Country::iraq(),
3587            "ireland" => Country::ireland(),
3588            "372" => Country::ireland(),
3589            "ie" => Country::ireland(),
3590            "irl" => Country::ireland(),
3591            "islamicrepublicofiran" => Country::islamic_republic_of_iran(),
3592            "islamic_republic_of_iran" => Country::islamic_republic_of_iran(),
3593            "364" => Country::islamic_republic_of_iran(),
3594            "ir" => Country::islamic_republic_of_iran(),
3595            "irn" => Country::islamic_republic_of_iran(),
3596            "iran" => Country::islamic_republic_of_iran(),
3597            "isleofman" => Country::isle_of_man(),
3598            "isle_of_man" => Country::isle_of_man(),
3599            "833" => Country::isle_of_man(),
3600            "im" => Country::isle_of_man(),
3601            "imn" => Country::isle_of_man(),
3602            "israel" => Country::israel(),
3603            "376" => Country::israel(),
3604            "il" => Country::israel(),
3605            "isr" => Country::israel(),
3606            "italy" => Country::italy(),
3607            "380" => Country::italy(),
3608            "it" => Country::italy(),
3609            "ita" => Country::italy(),
3610            "jamaica" => Country::jamaica(),
3611            "388" => Country::jamaica(),
3612            "jm" => Country::jamaica(),
3613            "jam" => Country::jamaica(),
3614            "japan" => Country::japan(),
3615            "392" => Country::japan(),
3616            "jp" => Country::japan(),
3617            "jpn" => Country::japan(),
3618            "jersey" => Country::jersey(),
3619            "832" => Country::jersey(),
3620            "je" => Country::jersey(),
3621            "jey" => Country::jersey(),
3622            "jordan" => Country::jordan(),
3623            "400" => Country::jordan(),
3624            "jo" => Country::jordan(),
3625            "jor" => Country::jordan(),
3626            "kazakhstan" => Country::kazakhstan(),
3627            "398" => Country::kazakhstan(),
3628            "kz" => Country::kazakhstan(),
3629            "kaz" => Country::kazakhstan(),
3630            "kenya" => Country::kenya(),
3631            "404" => Country::kenya(),
3632            "ke" => Country::kenya(),
3633            "ken" => Country::kenya(),
3634            "kiribati" => Country::kiribati(),
3635            "296" => Country::kiribati(),
3636            "ki" => Country::kiribati(),
3637            "kir" => Country::kiribati(),
3638            "kosovo" => Country::kosovo(),
3639            "383" => Country::kosovo(),
3640            "xk" => Country::kosovo(),
3641            "xkx" => Country::kosovo(),
3642            "kuwait" => Country::kuwait(),
3643            "414" => Country::kuwait(),
3644            "kw" => Country::kuwait(),
3645            "kwt" => Country::kuwait(),
3646            "kyrgyzstan" => Country::kyrgyzstan(),
3647            "417" => Country::kyrgyzstan(),
3648            "kg" => Country::kyrgyzstan(),
3649            "kgz" => Country::kyrgyzstan(),
3650            "latvia" => Country::latvia(),
3651            "428" => Country::latvia(),
3652            "lv" => Country::latvia(),
3653            "lva" => Country::latvia(),
3654            "lebanon" => Country::lebanon(),
3655            "422" => Country::lebanon(),
3656            "lb" => Country::lebanon(),
3657            "lbn" => Country::lebanon(),
3658            "lesotho" => Country::lesotho(),
3659            "426" => Country::lesotho(),
3660            "ls" => Country::lesotho(),
3661            "lso" => Country::lesotho(),
3662            "liberia" => Country::liberia(),
3663            "430" => Country::liberia(),
3664            "lr" => Country::liberia(),
3665            "lbr" => Country::liberia(),
3666            "libya" => Country::libya(),
3667            "434" => Country::libya(),
3668            "ly" => Country::libya(),
3669            "lby" => Country::libya(),
3670            "liechtenstein" => Country::liechtenstein(),
3671            "438" => Country::liechtenstein(),
3672            "li" => Country::liechtenstein(),
3673            "lie" => Country::liechtenstein(),
3674            "lithuania" => Country::lithuania(),
3675            "440" => Country::lithuania(),
3676            "lt" => Country::lithuania(),
3677            "ltu" => Country::lithuania(),
3678            "luxembourg" => Country::luxembourg(),
3679            "442" => Country::luxembourg(),
3680            "lu" => Country::luxembourg(),
3681            "lux" => Country::luxembourg(),
3682            "macao" => Country::macao(),
3683            "446" => Country::macao(),
3684            "mo" => Country::macao(),
3685            "mac" => Country::macao(),
3686            "madagascar" => Country::madagascar(),
3687            "450" => Country::madagascar(),
3688            "mg" => Country::madagascar(),
3689            "mdg" => Country::madagascar(),
3690            "malawi" => Country::malawi(),
3691            "454" => Country::malawi(),
3692            "mw" => Country::malawi(),
3693            "mwi" => Country::malawi(),
3694            "malaysia" => Country::malaysia(),
3695            "458" => Country::malaysia(),
3696            "my" => Country::malaysia(),
3697            "mys" => Country::malaysia(),
3698            "maldives" => Country::maldives(),
3699            "462" => Country::maldives(),
3700            "mv" => Country::maldives(),
3701            "mdv" => Country::maldives(),
3702            "mali" => Country::mali(),
3703            "466" => Country::mali(),
3704            "ml" => Country::mali(),
3705            "mli" => Country::mali(),
3706            "malta" => Country::malta(),
3707            "470" => Country::malta(),
3708            "mt" => Country::malta(),
3709            "mlt" => Country::malta(),
3710            "martinique" => Country::martinique(),
3711            "474" => Country::martinique(),
3712            "mq" => Country::martinique(),
3713            "mtq" => Country::martinique(),
3714            "mauritania" => Country::mauritania(),
3715            "478" => Country::mauritania(),
3716            "mr" => Country::mauritania(),
3717            "mrt" => Country::mauritania(),
3718            "mauritius" => Country::mauritius(),
3719            "480" => Country::mauritius(),
3720            "mu" => Country::mauritius(),
3721            "mus" => Country::mauritius(),
3722            "mayotte" => Country::mayotte(),
3723            "175" => Country::mayotte(),
3724            "yt" => Country::mayotte(),
3725            "myt" => Country::mayotte(),
3726            "mexico" => Country::mexico(),
3727            "484" => Country::mexico(),
3728            "mx" => Country::mexico(),
3729            "mex" => Country::mexico(),
3730            "monaco" => Country::monaco(),
3731            "492" => Country::monaco(),
3732            "mc" => Country::monaco(),
3733            "mco" => Country::monaco(),
3734            "mongolia" => Country::mongolia(),
3735            "496" => Country::mongolia(),
3736            "mn" => Country::mongolia(),
3737            "mng" => Country::mongolia(),
3738            "montenegro" => Country::montenegro(),
3739            "499" => Country::montenegro(),
3740            "me" => Country::montenegro(),
3741            "mne" => Country::montenegro(),
3742            "montserrat" => Country::montserrat(),
3743            "500" => Country::montserrat(),
3744            "ms" => Country::montserrat(),
3745            "msr" => Country::montserrat(),
3746            "morocco" => Country::morocco(),
3747            "504" => Country::morocco(),
3748            "ma" => Country::morocco(),
3749            "mar" => Country::morocco(),
3750            "mozambique" => Country::mozambique(),
3751            "508" => Country::mozambique(),
3752            "mz" => Country::mozambique(),
3753            "moz" => Country::mozambique(),
3754            "myanmar" => Country::myanmar(),
3755            "104" => Country::myanmar(),
3756            "mm" => Country::myanmar(),
3757            "mmr" => Country::myanmar(),
3758            "namibia" => Country::namibia(),
3759            "516" => Country::namibia(),
3760            "na" => Country::namibia(),
3761            "nam" => Country::namibia(),
3762            "nauru" => Country::nauru(),
3763            "520" => Country::nauru(),
3764            "nr" => Country::nauru(),
3765            "nru" => Country::nauru(),
3766            "nepal" => Country::nepal(),
3767            "524" => Country::nepal(),
3768            "np" => Country::nepal(),
3769            "npl" => Country::nepal(),
3770            "newcaledonia" => Country::new_caledonia(),
3771            "new_caledonia" => Country::new_caledonia(),
3772            "540" => Country::new_caledonia(),
3773            "nc" => Country::new_caledonia(),
3774            "ncl" => Country::new_caledonia(),
3775            "newzealand" => Country::new_zealand(),
3776            "new_zealand" => Country::new_zealand(),
3777            "554" => Country::new_zealand(),
3778            "nz" => Country::new_zealand(),
3779            "nzl" => Country::new_zealand(),
3780            "nicaragua" => Country::nicaragua(),
3781            "558" => Country::nicaragua(),
3782            "ni" => Country::nicaragua(),
3783            "nic" => Country::nicaragua(),
3784            "nigeria" => Country::nigeria(),
3785            "566" => Country::nigeria(),
3786            "ng" => Country::nigeria(),
3787            "nga" => Country::nigeria(),
3788            "niue" => Country::niue(),
3789            "570" => Country::niue(),
3790            "nu" => Country::niue(),
3791            "niu" => Country::niue(),
3792            "norfolkisland" => Country::norfolk_island(),
3793            "norfolk_island" => Country::norfolk_island(),
3794            "574" => Country::norfolk_island(),
3795            "nf" => Country::norfolk_island(),
3796            "nfk" => Country::norfolk_island(),
3797            "norway" => Country::norway(),
3798            "578" => Country::norway(),
3799            "no" => Country::norway(),
3800            "nor" => Country::norway(),
3801            "oman" => Country::oman(),
3802            "512" => Country::oman(),
3803            "om" => Country::oman(),
3804            "omn" => Country::oman(),
3805            "pakistan" => Country::pakistan(),
3806            "586" => Country::pakistan(),
3807            "pk" => Country::pakistan(),
3808            "pak" => Country::pakistan(),
3809            "palau" => Country::palau(),
3810            "585" => Country::palau(),
3811            "pw" => Country::palau(),
3812            "plw" => Country::palau(),
3813            "panama" => Country::panama(),
3814            "591" => Country::panama(),
3815            "pa" => Country::panama(),
3816            "pan" => Country::panama(),
3817            "papuanewguinea" => Country::papua_new_guinea(),
3818            "papua_new_guinea" => Country::papua_new_guinea(),
3819            "598" => Country::papua_new_guinea(),
3820            "pg" => Country::papua_new_guinea(),
3821            "png" => Country::papua_new_guinea(),
3822            "paraguay" => Country::paraguay(),
3823            "600" => Country::paraguay(),
3824            "py" => Country::paraguay(),
3825            "pry" => Country::paraguay(),
3826            "peru" => Country::peru(),
3827            "604" => Country::peru(),
3828            "pe" => Country::peru(),
3829            "per" => Country::peru(),
3830            "pitcairn" => Country::pitcairn(),
3831            "612" => Country::pitcairn(),
3832            "pn" => Country::pitcairn(),
3833            "pcn" => Country::pitcairn(),
3834            "poland" => Country::poland(),
3835            "616" => Country::poland(),
3836            "pl" => Country::poland(),
3837            "pol" => Country::poland(),
3838            "portugal" => Country::portugal(),
3839            "620" => Country::portugal(),
3840            "pt" => Country::portugal(),
3841            "prt" => Country::portugal(),
3842            "puertorico" => Country::puerto_rico(),
3843            "puerto_rico" => Country::puerto_rico(),
3844            "630" => Country::puerto_rico(),
3845            "pr" => Country::puerto_rico(),
3846            "pri" => Country::puerto_rico(),
3847            "qatar" => Country::qatar(),
3848            "634" => Country::qatar(),
3849            "qa" => Country::qatar(),
3850            "qat" => Country::qatar(),
3851            "republicofnorthmacedonia" => Country::republic_of_north_macedonia(),
3852            "republic_of_north_macedonia" => Country::republic_of_north_macedonia(),
3853            "807" => Country::republic_of_north_macedonia(),
3854            "mk" => Country::republic_of_north_macedonia(),
3855            "mkd" => Country::republic_of_north_macedonia(),
3856            "macedonia" => Country::republic_of_north_macedonia(),
3857            "reunion" => Country::reunion(),
3858            "638" => Country::reunion(),
3859            "re" => Country::reunion(),
3860            "reu" => Country::reunion(),
3861            "romania" => Country::romania(),
3862            "642" => Country::romania(),
3863            "ro" => Country::romania(),
3864            "rou" => Country::romania(),
3865            "rwanda" => Country::rwanda(),
3866            "646" => Country::rwanda(),
3867            "rw" => Country::rwanda(),
3868            "rwa" => Country::rwanda(),
3869            "saintbarthelemy" => Country::saint_barthelemy(),
3870            "saint_barthelemy" => Country::saint_barthelemy(),
3871            "652" => Country::saint_barthelemy(),
3872            "bl" => Country::saint_barthelemy(),
3873            "blm" => Country::saint_barthelemy(),
3874            "stbarthelemy" => Country::saint_barthelemy(),
3875            "saintkittsandnevis" => Country::saint_kitts_and_nevis(),
3876            "saint_kitts_and_nevis" => Country::saint_kitts_and_nevis(),
3877            "659" => Country::saint_kitts_and_nevis(),
3878            "kn" => Country::saint_kitts_and_nevis(),
3879            "kna" => Country::saint_kitts_and_nevis(),
3880            "stkitts" => Country::saint_kitts_and_nevis(),
3881            "saintlucia" => Country::saint_lucia(),
3882            "saint_lucia" => Country::saint_lucia(),
3883            "662" => Country::saint_lucia(),
3884            "lc" => Country::saint_lucia(),
3885            "lca" => Country::saint_lucia(),
3886            "stlucia" => Country::saint_lucia(),
3887            "saintpierreandmiquelon" => Country::saint_pierre_and_miquelon(),
3888            "saint_pierre_and_miquelon" => Country::saint_pierre_and_miquelon(),
3889            "666" => Country::saint_pierre_and_miquelon(),
3890            "pm" => Country::saint_pierre_and_miquelon(),
3891            "spm" => Country::saint_pierre_and_miquelon(),
3892            "stpierre" => Country::saint_pierre_and_miquelon(),
3893            "saintpierre" => Country::saint_pierre_and_miquelon(),
3894            "saintvincentandthegrenadines" => Country::saint_vincent_and_the_grenadines(),
3895            "saint_vincent_and_the_grenadines" => Country::saint_vincent_and_the_grenadines(),
3896            "670" => Country::saint_vincent_and_the_grenadines(),
3897            "vc" => Country::saint_vincent_and_the_grenadines(),
3898            "vct" => Country::saint_vincent_and_the_grenadines(),
3899            "stvincent" => Country::saint_vincent_and_the_grenadines(),
3900            "saintvincent" => Country::saint_vincent_and_the_grenadines(),
3901            "samoa" => Country::samoa(),
3902            "882" => Country::samoa(),
3903            "ws" => Country::samoa(),
3904            "wsm" => Country::samoa(),
3905            "sanmarino" => Country::san_marino(),
3906            "san_marino" => Country::san_marino(),
3907            "674" => Country::san_marino(),
3908            "sm" => Country::san_marino(),
3909            "smr" => Country::san_marino(),
3910            "saotomeandprincipe" => Country::sao_tome_and_principe(),
3911            "sao_tome_and_principe" => Country::sao_tome_and_principe(),
3912            "678" => Country::sao_tome_and_principe(),
3913            "st" => Country::sao_tome_and_principe(),
3914            "stp" => Country::sao_tome_and_principe(),
3915            "saotome" => Country::sao_tome_and_principe(),
3916            "saudiarabia" => Country::saudi_arabia(),
3917            "saudi_arabia" => Country::saudi_arabia(),
3918            "682" => Country::saudi_arabia(),
3919            "sa" => Country::saudi_arabia(),
3920            "sau" => Country::saudi_arabia(),
3921            "senegal" => Country::senegal(),
3922            "686" => Country::senegal(),
3923            "sn" => Country::senegal(),
3924            "sen" => Country::senegal(),
3925            "serbia" => Country::serbia(),
3926            "688" => Country::serbia(),
3927            "rs" => Country::serbia(),
3928            "srb" => Country::serbia(),
3929            "seychelles" => Country::seychelles(),
3930            "690" => Country::seychelles(),
3931            "sc" => Country::seychelles(),
3932            "syc" => Country::seychelles(),
3933            "sierraleone" => Country::sierra_leone(),
3934            "sierra_leone" => Country::sierra_leone(),
3935            "694" => Country::sierra_leone(),
3936            "sl" => Country::sierra_leone(),
3937            "sle" => Country::sierra_leone(),
3938            "singapore" => Country::singapore(),
3939            "702" => Country::singapore(),
3940            "sg" => Country::singapore(),
3941            "sgp" => Country::singapore(),
3942            "slovakia" => Country::slovakia(),
3943            "703" => Country::slovakia(),
3944            "sk" => Country::slovakia(),
3945            "svk" => Country::slovakia(),
3946            "slovenia" => Country::slovenia(),
3947            "705" => Country::slovenia(),
3948            "si" => Country::slovenia(),
3949            "svn" => Country::slovenia(),
3950            "solomonislands" => Country::solomon_islands(),
3951            "solomon_islands" => Country::solomon_islands(),
3952            "090" => Country::solomon_islands(),
3953            "sb" => Country::solomon_islands(),
3954            "slb" => Country::solomon_islands(),
3955            "somalia" => Country::somalia(),
3956            "706" => Country::somalia(),
3957            "so" => Country::somalia(),
3958            "som" => Country::somalia(),
3959            "southafrica" => Country::south_africa(),
3960            "south_africa" => Country::south_africa(),
3961            "710" => Country::south_africa(),
3962            "za" => Country::south_africa(),
3963            "zaf" => Country::south_africa(),
3964            "southgeorgiaandthesouthsandwichislands" => Country::south_georgia_and_the_south_sandwich_islands(),
3965            "south_georgia_and_the_south_sandwich_islands" => Country::south_georgia_and_the_south_sandwich_islands(),
3966            "239" => Country::south_georgia_and_the_south_sandwich_islands(),
3967            "gs" => Country::south_georgia_and_the_south_sandwich_islands(),
3968            "sgs" => Country::south_georgia_and_the_south_sandwich_islands(),
3969            "southgeorgia" => Country::south_georgia_and_the_south_sandwich_islands(),
3970            "southsandwichislands" => Country::south_georgia_and_the_south_sandwich_islands(),
3971            "southsudan" => Country::south_sudan(),
3972            "south_sudan" => Country::south_sudan(),
3973            "728" => Country::south_sudan(),
3974            "ss" => Country::south_sudan(),
3975            "ssd" => Country::south_sudan(),
3976            "spain" => Country::spain(),
3977            "724" => Country::spain(),
3978            "es" => Country::spain(),
3979            "esp" => Country::spain(),
3980            "srilanka" => Country::sri_lanka(),
3981            "sri_lanka" => Country::sri_lanka(),
3982            "144" => Country::sri_lanka(),
3983            "lk" => Country::sri_lanka(),
3984            "lka" => Country::sri_lanka(),
3985            "stateofpalestine" => Country::state_of_palestine(),
3986            "state_of_palestine" => Country::state_of_palestine(),
3987            "275" => Country::state_of_palestine(),
3988            "ps" => Country::state_of_palestine(),
3989            "pse" => Country::state_of_palestine(),
3990            "palestine" => Country::state_of_palestine(),
3991            "suriname" => Country::suriname(),
3992            "740" => Country::suriname(),
3993            "sr" => Country::suriname(),
3994            "sur" => Country::suriname(),
3995            "svalbardandjanmayen" => Country::svalbard_and_jan_mayen(),
3996            "svalbard_and_jan_mayen" => Country::svalbard_and_jan_mayen(),
3997            "744" => Country::svalbard_and_jan_mayen(),
3998            "sj" => Country::svalbard_and_jan_mayen(),
3999            "sjm" => Country::svalbard_and_jan_mayen(),
4000            "sweden" => Country::sweden(),
4001            "752" => Country::sweden(),
4002            "se" => Country::sweden(),
4003            "swe" => Country::sweden(),
4004            "switzerland" => Country::switzerland(),
4005            "756" => Country::switzerland(),
4006            "ch" => Country::switzerland(),
4007            "che" => Country::switzerland(),
4008            "syrianarabrepublic" => Country::syrian_arab_republic(),
4009            "syrian_arab_republic" => Country::syrian_arab_republic(),
4010            "760" => Country::syrian_arab_republic(),
4011            "sy" => Country::syrian_arab_republic(),
4012            "syr" => Country::syrian_arab_republic(),
4013            "taiwan,republicofchina" => Country::taiwan(),
4014            "taiwan" => Country::taiwan(),
4015            "158" => Country::taiwan(),
4016            "tw" => Country::taiwan(),
4017            "twn" => Country::taiwan(),
4018            "tajikistan" => Country::tajikistan(),
4019            "762" => Country::tajikistan(),
4020            "tj" => Country::tajikistan(),
4021            "tjk" => Country::tajikistan(),
4022            "thailand" => Country::thailand(),
4023            "764" => Country::thailand(),
4024            "th" => Country::thailand(),
4025            "tha" => Country::thailand(),
4026            "thebahamas" => Country::the_bahamas(),
4027            "the_bahamas" => Country::the_bahamas(),
4028            "044" => Country::the_bahamas(),
4029            "bs" => Country::the_bahamas(),
4030            "bhs" => Country::the_bahamas(),
4031            "bahamas" => Country::the_bahamas(),
4032            "thecaymanislands" => Country::the_cayman_islands(),
4033            "the_cayman_islands" => Country::the_cayman_islands(),
4034            "136" => Country::the_cayman_islands(),
4035            "ky" => Country::the_cayman_islands(),
4036            "cym" => Country::the_cayman_islands(),
4037            "caymanislands" => Country::the_cayman_islands(),
4038            "thecentralafricanrepublic" => Country::the_central_african_republic(),
4039            "the_central_african_republic" => Country::the_central_african_republic(),
4040            "140" => Country::the_central_african_republic(),
4041            "cf" => Country::the_central_african_republic(),
4042            "caf" => Country::the_central_african_republic(),
4043            "centralafricanrepublic" => Country::the_central_african_republic(),
4044            "thecocoskeelingislands" => Country::the_cocos_keeling_islands(),
4045            "the_cocos_keeling_islands" => Country::the_cocos_keeling_islands(),
4046            "166" => Country::the_cocos_keeling_islands(),
4047            "cc" => Country::the_cocos_keeling_islands(),
4048            "cck" => Country::the_cocos_keeling_islands(),
4049            "cocosislands" => Country::the_cocos_keeling_islands(),
4050            "keelingislands" => Country::the_cocos_keeling_islands(),
4051            "thecomoros" => Country::the_comoros(),
4052            "the_comoros" => Country::the_comoros(),
4053            "174" => Country::the_comoros(),
4054            "km" => Country::the_comoros(),
4055            "com" => Country::the_comoros(),
4056            "comoros" => Country::the_comoros(),
4057            "thecongo" => Country::the_congo(),
4058            "the_congo" => Country::the_congo(),
4059            "178" => Country::the_congo(),
4060            "cg" => Country::the_congo(),
4061            "cog" => Country::the_congo(),
4062            "congo" => Country::the_congo(),
4063            "thecookislands" => Country::the_cook_islands(),
4064            "the_cook_islands" => Country::the_cook_islands(),
4065            "184" => Country::the_cook_islands(),
4066            "ck" => Country::the_cook_islands(),
4067            "cok" => Country::the_cook_islands(),
4068            "cookislands" => Country::the_cook_islands(),
4069            "thedemocraticpeoplesrepublicofkorea" => Country::the_democratic_peoples_republic_of_korea(),
4070            "the_democratic_peoples_republic_of_korea" => Country::the_democratic_peoples_republic_of_korea(),
4071            "408" => Country::the_democratic_peoples_republic_of_korea(),
4072            "kp" => Country::the_democratic_peoples_republic_of_korea(),
4073            "prk" => Country::the_democratic_peoples_republic_of_korea(),
4074            "northkorea" => Country::the_democratic_peoples_republic_of_korea(),
4075            "democraticpeoplesrepublicofkorea" => Country::the_democratic_peoples_republic_of_korea(),
4076            "thedemocraticrepublicofthecongo" => Country::the_democratic_republic_of_the_congo(),
4077            "the_democratic_republic_of_the_congo" => Country::the_democratic_republic_of_the_congo(),
4078            "180" => Country::the_democratic_republic_of_the_congo(),
4079            "cd" => Country::the_democratic_republic_of_the_congo(),
4080            "cod" => Country::the_democratic_republic_of_the_congo(),
4081            "democraticrepublicofthecongo" => Country::the_democratic_republic_of_the_congo(),
4082            "thedominicanrepublic" => Country::the_dominican_republic(),
4083            "the_dominican_republic" => Country::the_dominican_republic(),
4084            "214" => Country::the_dominican_republic(),
4085            "do" => Country::the_dominican_republic(),
4086            "dom" => Country::the_dominican_republic(),
4087            "dominicanrepublic" => Country::the_dominican_republic(),
4088            "thefalklandislandsmalvinas" => Country::the_falkland_islands_malvinas(),
4089            "the_falkland_islands_malvinas" => Country::the_falkland_islands_malvinas(),
4090            "238" => Country::the_falkland_islands_malvinas(),
4091            "fk" => Country::the_falkland_islands_malvinas(),
4092            "flk" => Country::the_falkland_islands_malvinas(),
4093            "malvinas" => Country::the_falkland_islands_malvinas(),
4094            "falklandislands" => Country::the_falkland_islands_malvinas(),
4095            "thefaroeislands" => Country::the_faroe_islands(),
4096            "the_faroe_islands" => Country::the_faroe_islands(),
4097            "234" => Country::the_faroe_islands(),
4098            "fo" => Country::the_faroe_islands(),
4099            "fro" => Country::the_faroe_islands(),
4100            "faroeislands" => Country::the_faroe_islands(),
4101            "thefrenchsouthernterritories" => Country::the_french_southern_territories(),
4102            "the_french_southern_territories" => Country::the_french_southern_territories(),
4103            "260" => Country::the_french_southern_territories(),
4104            "tf" => Country::the_french_southern_territories(),
4105            "atf" => Country::the_french_southern_territories(),
4106            "frenchsouthernterritories" => Country::the_french_southern_territories(),
4107            "thegambia" => Country::the_gambia(),
4108            "the_gambia" => Country::the_gambia(),
4109            "270" => Country::the_gambia(),
4110            "gm" => Country::the_gambia(),
4111            "gmb" => Country::the_gambia(),
4112            "gambia" => Country::the_gambia(),
4113            "theholysee" => Country::the_holy_see(),
4114            "the_holy_see" => Country::the_holy_see(),
4115            "336" => Country::the_holy_see(),
4116            "va" => Country::the_holy_see(),
4117            "vat" => Country::the_holy_see(),
4118            "holysee" => Country::the_holy_see(),
4119            "thelaopeoplesdemocraticrepublic" => Country::the_lao_peoples_democratic_republic(),
4120            "the_lao_peoples_democratic_republic" => Country::the_lao_peoples_democratic_republic(),
4121            "418" => Country::the_lao_peoples_democratic_republic(),
4122            "la" => Country::the_lao_peoples_democratic_republic(),
4123            "lao" => Country::the_lao_peoples_democratic_republic(),
4124            "laopeoplesdemocraticrepublic" => Country::the_lao_peoples_democratic_republic(),
4125            "themarshallislands" => Country::the_marshall_islands(),
4126            "the_marshall_islands" => Country::the_marshall_islands(),
4127            "584" => Country::the_marshall_islands(),
4128            "mh" => Country::the_marshall_islands(),
4129            "mhl" => Country::the_marshall_islands(),
4130            "marshallislands" => Country::the_marshall_islands(),
4131            "thenetherlands" => Country::the_netherlands(),
4132            "the_netherlands" => Country::the_netherlands(),
4133            "528" => Country::the_netherlands(),
4134            "nl" => Country::the_netherlands(),
4135            "nld" => Country::the_netherlands(),
4136            "netherlands" => Country::the_netherlands(),
4137            "holland" => Country::the_netherlands(),
4138            "theniger" => Country::the_niger(),
4139            "the_niger" => Country::the_niger(),
4140            "562" => Country::the_niger(),
4141            "ne" => Country::the_niger(),
4142            "ner" => Country::the_niger(),
4143            "niger" => Country::the_niger(),
4144            "thenorthernmarianaislands" => Country::the_northern_mariana_islands(),
4145            "the_northern_mariana_islands" => Country::the_northern_mariana_islands(),
4146            "580" => Country::the_northern_mariana_islands(),
4147            "mp" => Country::the_northern_mariana_islands(),
4148            "mnp" => Country::the_northern_mariana_islands(),
4149            "northernmarianaislands" => Country::the_northern_mariana_islands(),
4150            "thephilippines" => Country::the_philippines(),
4151            "the_philippines" => Country::the_philippines(),
4152            "608" => Country::the_philippines(),
4153            "ph" => Country::the_philippines(),
4154            "phl" => Country::the_philippines(),
4155            "philippines" => Country::the_philippines(),
4156            "therepublicofkorea" => Country::the_republic_of_korea(),
4157            "the_republic_of_korea" => Country::the_republic_of_korea(),
4158            "410" => Country::the_republic_of_korea(),
4159            "kr" => Country::the_republic_of_korea(),
4160            "kor" => Country::the_republic_of_korea(),
4161            "southkorea" => Country::the_republic_of_korea(),
4162            "republicofkorea" => Country::the_republic_of_korea(),
4163            "therepublicofmoldova" => Country::the_republic_of_moldova(),
4164            "the_republic_of_moldova" => Country::the_republic_of_moldova(),
4165            "498" => Country::the_republic_of_moldova(),
4166            "md" => Country::the_republic_of_moldova(),
4167            "mda" => Country::the_republic_of_moldova(),
4168            "moldova" => Country::the_republic_of_moldova(),
4169            "republicofmoldova" => Country::the_republic_of_moldova(),
4170            "therussianfederation" => Country::the_russian_federation(),
4171            "the_russian_federation" => Country::the_russian_federation(),
4172            "643" => Country::the_russian_federation(),
4173            "ru" => Country::the_russian_federation(),
4174            "rus" => Country::the_russian_federation(),
4175            "russia" => Country::the_russian_federation(),
4176            "russianfederation" => Country::the_russian_federation(),
4177            "thesudan" => Country::the_sudan(),
4178            "the_sudan" => Country::the_sudan(),
4179            "729" => Country::the_sudan(),
4180            "sd" => Country::the_sudan(),
4181            "sdn" => Country::the_sudan(),
4182            "sudan" => Country::the_sudan(),
4183            "theturksandcaicosislands" => Country::the_turks_and_caicos_islands(),
4184            "the_turks_and_caicos_islands" => Country::the_turks_and_caicos_islands(),
4185            "796" => Country::the_turks_and_caicos_islands(),
4186            "tc" => Country::the_turks_and_caicos_islands(),
4187            "tca" => Country::the_turks_and_caicos_islands(),
4188            "turksandcaicosislands" => Country::the_turks_and_caicos_islands(),
4189            "theunitedarabemirates" => Country::the_united_arab_emirates(),
4190            "the_united_arab_emirates" => Country::the_united_arab_emirates(),
4191            "784" => Country::the_united_arab_emirates(),
4192            "ae" => Country::the_united_arab_emirates(),
4193            "are" => Country::the_united_arab_emirates(),
4194            "unitedarabemirates" => Country::the_united_arab_emirates(),
4195            "theunitedkingdomofgreatbritainandnorthernireland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4196            "the_united_kingdom_of_great_britain_and_northern_ireland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4197            "826" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4198            "gb" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4199            "gbr" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4200            "england" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4201            "scotland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4202            "greatbritain" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4203            "unitedkingdom" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4204            "northernireland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4205            "unitedkingdomofgreatbritain" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4206            "unitedkingdomofgreatbritainandnorthernireland" => Country::the_united_kingdom_of_great_britain_and_northern_ireland(),
4207            "theunitedstatesminoroutlyingislands" => Country::the_united_states_minor_outlying_islands(),
4208            "the_united_states_minor_outlying_islands" => Country::the_united_states_minor_outlying_islands(),
4209            "581" => Country::the_united_states_minor_outlying_islands(),
4210            "um" => Country::the_united_states_minor_outlying_islands(),
4211            "umi" => Country::the_united_states_minor_outlying_islands(),
4212            "unitedstatesminoroutlyingislands" => Country::the_united_states_minor_outlying_islands(),
4213            "theunitedstatesofamerica" => Country::the_united_states_of_america(),
4214            "the_united_states_of_america" => Country::the_united_states_of_america(),
4215            "840" => Country::the_united_states_of_america(),
4216            "us" => Country::the_united_states_of_america(),
4217            "usa" => Country::the_united_states_of_america(),
4218            "america" => Country::the_united_states_of_america(),
4219            "united states" => Country::the_united_states_of_america(),
4220            "unitedstates" => Country::the_united_states_of_america(),
4221            "unitedstatesofamerica" => Country::the_united_states_of_america(),
4222            "united_states_of_america" => Country::the_united_states_of_america(),
4223            "timorleste" => Country::timor_leste(),
4224            "timor_leste" => Country::timor_leste(),
4225            "626" => Country::timor_leste(),
4226            "tl" => Country::timor_leste(),
4227            "tls" => Country::timor_leste(),
4228            "togo" => Country::togo(),
4229            "768" => Country::togo(),
4230            "tg" => Country::togo(),
4231            "tgo" => Country::togo(),
4232            "tokelau" => Country::tokelau(),
4233            "772" => Country::tokelau(),
4234            "tk" => Country::tokelau(),
4235            "tkl" => Country::tokelau(),
4236            "tonga" => Country::tonga(),
4237            "776" => Country::tonga(),
4238            "to" => Country::tonga(),
4239            "ton" => Country::tonga(),
4240            "trinidadandtobago" => Country::trinidad_and_tobago(),
4241            "trinidad_and_tobago" => Country::trinidad_and_tobago(),
4242            "780" => Country::trinidad_and_tobago(),
4243            "tt" => Country::trinidad_and_tobago(),
4244            "tto" => Country::trinidad_and_tobago(),
4245            "trinidad" => Country::trinidad_and_tobago(),
4246            "tobago" => Country::trinidad_and_tobago(),
4247            "tunisia" => Country::tunisia(),
4248            "788" => Country::tunisia(),
4249            "tn" => Country::tunisia(),
4250            "tun" => Country::tunisia(),
4251            "turkey" => Country::turkey(),
4252            "türkiye" => Country::turkey(),
4253            "792" => Country::turkey(),
4254            "tr" => Country::turkey(),
4255            "tur" => Country::turkey(),
4256            "turkmenistan" => Country::turkmenistan(),
4257            "795" => Country::turkmenistan(),
4258            "tm" => Country::turkmenistan(),
4259            "tkm" => Country::turkmenistan(),
4260            "tuvalu" => Country::tuvalu(),
4261            "798" => Country::tuvalu(),
4262            "tv" => Country::tuvalu(),
4263            "tuv" => Country::tuvalu(),
4264            "usvirginislands" => Country::us_virgin_islands(),
4265            "us_virgin_islands" => Country::us_virgin_islands(),
4266            "850" => Country::us_virgin_islands(),
4267            "vi" => Country::us_virgin_islands(),
4268            "vir" => Country::us_virgin_islands(),
4269            "uganda" => Country::uganda(),
4270            "800" => Country::uganda(),
4271            "ug" => Country::uganda(),
4272            "uga" => Country::uganda(),
4273            "ukraine" => Country::ukraine(),
4274            "804" => Country::ukraine(),
4275            "ua" => Country::ukraine(),
4276            "ukr" => Country::ukraine(),
4277            "unitedrepublicoftanzania" => Country::united_republic_of_tanzania(),
4278            "united_republic_of_tanzania" => Country::united_republic_of_tanzania(),
4279            "834" => Country::united_republic_of_tanzania(),
4280            "tz" => Country::united_republic_of_tanzania(),
4281            "tza" => Country::united_republic_of_tanzania(),
4282            "tanzania" => Country::united_republic_of_tanzania(),
4283            "uruguay" => Country::uruguay(),
4284            "858" => Country::uruguay(),
4285            "uy" => Country::uruguay(),
4286            "ury" => Country::uruguay(),
4287            "uzbekistan" => Country::uzbekistan(),
4288            "860" => Country::uzbekistan(),
4289            "uz" => Country::uzbekistan(),
4290            "uzb" => Country::uzbekistan(),
4291            "vanuatu" => Country::vanuatu(),
4292            "548" => Country::vanuatu(),
4293            "vu" => Country::vanuatu(),
4294            "vut" => Country::vanuatu(),
4295            "vietnam" => Country::vietnam(),
4296            "704" => Country::vietnam(),
4297            "vn" => Country::vietnam(),
4298            "vnm" => Country::vietnam(),
4299            "wallisandfutuna" => Country::wallis_and_futuna(),
4300            "wallis_and_futuna" => Country::wallis_and_futuna(),
4301            "876" => Country::wallis_and_futuna(),
4302            "wf" => Country::wallis_and_futuna(),
4303            "wlf" => Country::wallis_and_futuna(),
4304            "westernsahara" => Country::western_sahara(),
4305            "western_sahara" => Country::western_sahara(),
4306            "732" => Country::western_sahara(),
4307            "eh" => Country::western_sahara(),
4308            "esh" => Country::western_sahara(),
4309            "yemen" => Country::yemen(),
4310            "887" => Country::yemen(),
4311            "ye" => Country::yemen(),
4312            "yem" => Country::yemen(),
4313            "zambia" => Country::zambia(),
4314            "894" => Country::zambia(),
4315            "zm" => Country::zambia(),
4316            "zmb" => Country::zambia(),
4317            "zimbabwe" => Country::zimbabwe(),
4318            "716" => Country::zimbabwe(),
4319            "zw" => Country::zimbabwe(),
4320            "zwe" => Country::zimbabwe(),
4321        };
4322        lookup_ascii_lowercase(&CODES, code)
4323            .copied()
4324            .ok_or("unknown value")
4325    }
4326}