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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// ISC License (ISC)
//
// Copyright (c) 2016, Austin Hellyer <hello@austinhellyer.me>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
// RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
// CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// What is ISO 3166-3?
// | ISO 3166-3 is part of the ISO 3166 standard published by the International
// | Organization for Standardization (ISO), and defines codes for country
// | names which have been deleted from ISO 3166-1 since its first publication
// | in 1974.
// |
// | - [Wikipedia](http://en.wikipedia.org/wiki/ISO_3166-3)
//
// Originally by zeyla on GitHub.
pub use former_country_codes as all;
/// A representation of a Former Country Code's ISO 3166-1 information.
/// Struct defining a Former Country Code as defined by ISO 3166-3.
/// Returns the `FormerCountryCode` if one is found matching the given code.
///
/// # Examples
///
/// ```
/// let _country = iso3166_3::code("DDDE");
/// ```
/// Returns a `Vec` of ISO 3166-3 `FormerCountryCode`s that were valid from a
/// range of the given years.
///
/// # Examples
///
/// Retrieve codes valid from years 1974-1990:
///
/// ```
/// let _countries = iso3166_3::validity(Some(1974), Some(1990));
/// ```
///
/// Retrieve codes valid from the year 1990 onward:
///
/// ```
/// let _countries = iso3166_3::validity(Some(1990), None);
/// ```
///
/// Retrieve codes valid until 1998 and prior:
///
/// ```
/// let _countries = iso3166_3::validity(None, Some(1998));
/// ```