1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
crate::ix!();
pub trait Abbreviation {
fn abbreviation(&self) -> &'static str;
}
impl Abbreviation for EuropeRegion {
fn abbreviation(&self) -> &'static str {
match self {
EuropeRegion::Albania => "AL",
EuropeRegion::Andorra => "AD",
EuropeRegion::Austria => "AT",
EuropeRegion::Azores => "PT-AC", // Azores (Autonomous Region of Portugal)
EuropeRegion::Belarus => "BY",
EuropeRegion::Belgium => "BE",
EuropeRegion::BosniaHerzegovina => "BA",
EuropeRegion::Bulgaria => "BG",
EuropeRegion::Croatia => "HR",
EuropeRegion::Cyprus => "CY",
EuropeRegion::CzechRepublic => "CZ",
EuropeRegion::Denmark => "DK",
EuropeRegion::Estonia => "EE",
EuropeRegion::FaroeIslands => "FO",
EuropeRegion::Finland => "FI",
EuropeRegion::Georgia => "GE",
EuropeRegion::Greece => "GR",
EuropeRegion::GuernseyAndJersey => "GG-JE",
EuropeRegion::Hungary => "HU",
EuropeRegion::Iceland => "IS",
EuropeRegion::IrelandAndNorthernIreland => "IE-GB-NI", // Ireland and Northern Ireland combined is non-standard. Let's just combine codes:
EuropeRegion::IsleOfMan => "IM",
EuropeRegion::Kosovo => "XK",
EuropeRegion::Latvia => "LV",
EuropeRegion::Liechtenstein => "LI",
EuropeRegion::Lithuania => "LT",
EuropeRegion::Luxembourg => "LU",
EuropeRegion::Macedonia => "MK",
EuropeRegion::Malta => "MT",
EuropeRegion::Moldova => "MD",
EuropeRegion::Monaco => "MC",
EuropeRegion::Montenegro => "ME",
EuropeRegion::Norway => "NO",
EuropeRegion::Portugal => "PT",
EuropeRegion::Romania => "RO",
EuropeRegion::Serbia => "RS",
EuropeRegion::Slovakia => "SK",
EuropeRegion::Slovenia => "SI",
EuropeRegion::Sweden => "SE",
EuropeRegion::Switzerland => "CH",
EuropeRegion::Turkey => "TR",
EuropeRegion::UkraineWithCrimea => "UA-CR", // Ukraine (with Crimea) is non-standard; let's just "UA-CR"
// Subdivided countries - call their abbreviation methods, which we will fully enumerate below:
EuropeRegion::France(_) => "FR",
EuropeRegion::Germany(_) => "DE",
EuropeRegion::Italy(_) => "IT",
EuropeRegion::Netherlands(_) => "NL",
EuropeRegion::Poland(_) => "PL",
EuropeRegion::RussianFederation(_) => "RU",
EuropeRegion::Spain(_) => "ES",
EuropeRegion::UnitedKingdom(_) => "GB",
}
}
}