| 1 | //! Parsing zoneinfo data files, line-by-line. |
| 2 | //! |
| 3 | //! This module provides functions that take a line of input from a zoneinfo |
| 4 | //! data file and attempts to parse it, returning the details of the line if |
| 5 | //! it gets parsed successfully. It classifies them as `Rule`, `Link`, |
| 6 | //! `Zone`, or `Continuation` lines. |
| 7 | //! |
| 8 | //! `Line` is the type that parses and holds zoneinfo line data. To try to |
| 9 | //! parse a string, use the `Line::from_str` constructor. (This isn’t the |
| 10 | //! `FromStr` trait, so you can’t use `parse` on a string. Sorry!) |
| 11 | //! |
| 12 | //! ## Examples |
| 13 | //! |
| 14 | //! Parsing a `Rule` line: |
| 15 | //! |
| 16 | //! ``` |
| 17 | //! use parse_zoneinfo::line::*; |
| 18 | //! |
| 19 | //! let line = Line::new("Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S"); |
| 20 | //! |
| 21 | //! assert_eq!(line, Ok(Line::Rule(Rule { |
| 22 | //! name: "EU", |
| 23 | //! from_year: Year::Number(1977), |
| 24 | //! to_year: Some(Year::Number(1980)), |
| 25 | //! month: Month::April, |
| 26 | //! day: DaySpec::FirstOnOrAfter(Weekday::Sunday, 1), |
| 27 | //! time: TimeSpec::HoursMinutes(1, 0).with_type(TimeType::UTC), |
| 28 | //! time_to_add: TimeSpec::HoursMinutes(1, 0), |
| 29 | //! letters: Some("S"), |
| 30 | //! }))); |
| 31 | //! ``` |
| 32 | //! |
| 33 | //! Parsing a `Zone` line: |
| 34 | //! |
| 35 | //! ``` |
| 36 | //! use parse_zoneinfo::line::*; |
| 37 | //! |
| 38 | //! let line = Line::new("Zone Australia/Adelaide 9:30 Aus AC%sT 1971 Oct 31 2:00:00"); |
| 39 | //! |
| 40 | //! assert_eq!(line, Ok(Line::Zone(Zone { |
| 41 | //! name: "Australia/Adelaide", |
| 42 | //! info: ZoneInfo { |
| 43 | //! utc_offset: TimeSpec::HoursMinutes(9, 30), |
| 44 | //! saving: Saving::Multiple("Aus"), |
| 45 | //! format: "AC%sT", |
| 46 | //! time: Some(ChangeTime::UntilTime( |
| 47 | //! Year::Number(1971), |
| 48 | //! Month::October, |
| 49 | //! DaySpec::Ordinal(31), |
| 50 | //! TimeSpec::HoursMinutesSeconds(2, 0, 0).with_type(TimeType::Wall)) |
| 51 | //! ), |
| 52 | //! }, |
| 53 | //! }))); |
| 54 | //! ``` |
| 55 | //! |
| 56 | //! Parsing a `Link` line: |
| 57 | //! |
| 58 | //! ``` |
| 59 | //! use parse_zoneinfo::line::*; |
| 60 | //! |
| 61 | //! let line = Line::new("Link Europe/Istanbul Asia/Istanbul"); |
| 62 | //! assert_eq!(line, Ok(Line::Link(Link { |
| 63 | //! existing: "Europe/Istanbul", |
| 64 | //! new: "Asia/Istanbul", |
| 65 | //! }))); |
| 66 | //! ``` |
| 67 | |
| 68 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/; |
| 69 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/::FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#; |
| 70 | |
| 71 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 72 | pub enum Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error# { |
| 73 | FailedYearParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedYearParse#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 74 | FailedMonthParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedMonthParse#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 75 | FailedWeekdayParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedWeekdayParse#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 76 | InvalidLineTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidLineType#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 77 | TypeColumnContainedNonHyphenrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#TypeColumnContainedNonHyphen#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 78 | CouldNotParseSavingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#CouldNotParseSaving#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 79 | InvalidDaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidDaySpec#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 80 | InvalidTimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidTimeSpecAndType#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 81 | NonWallClockInTimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NonWallClockInTimeSpec#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 82 | NotParsedAsRuleLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsRuleLine#, |
| 83 | NotParsedAsZoneLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsZoneLine#, |
| 84 | NotParsedAsLinkLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsLinkLine#, |
| 85 | } |
| 86 | |
| 87 | impl fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error# { |
| 88 | fn fmtrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Error][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 89 | match self { |
| 90 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::FailedYearParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedYearParse#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "failed to parse as a year value: \"{}\"", s), |
| 91 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::FailedMonthParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedMonthParse#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "failed to parse as a month value: \"{}\"", s), |
| 92 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::FailedWeekdayParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedWeekdayParse#(s) => { |
| 93 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "failed to parse as a weekday value: \"{}\"", s) |
| 94 | } |
| 95 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidLineTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidLineType#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "line with invalid format: \"{}\"", s), |
| 96 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::TypeColumnContainedNonHyphenrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#TypeColumnContainedNonHyphen#(s) => { |
| 97 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 98 | f, |
| 99 | "'type' column is not a hyphen but has the value: \"{}\"", |
| 100 | s |
| 101 | ) |
| 102 | } |
| 103 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::CouldNotParseSavingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#CouldNotParseSaving#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "failed to parse RULES column: \"{}\"", s), |
| 104 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidDaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidDaySpec#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "invalid day specification ('ON'): \"{}\"", s), |
| 105 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidTimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidTimeSpecAndType#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "invalid time: \"{}\"", s), |
| 106 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NonWallClockInTimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NonWallClockInTimeSpec#(s) => { |
| 107 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "time value not given as wall time: \"{}\"", s) |
| 108 | } |
| 109 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsRuleLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsRuleLine# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "failed to parse line as a rule"), |
| 110 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsZoneLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsZoneLine# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "failed to parse line as a zone"), |
| 111 | Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsLinkLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsLinkLine# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "failed to parse line as a link"), |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | impl stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error# {} |
| 117 | |
| 118 | /// A **year** definition field. |
| 119 | /// |
| 120 | /// A year has one of the following representations in a file: |
| 121 | /// |
| 122 | /// - `min` or `minimum`, the minimum year possible, for when a rule needs to |
| 123 | /// apply up until the first rule with a specific year; |
| 124 | /// - `max` or `maximum`, the maximum year possible, for when a rule needs to |
| 125 | /// apply after the last rule with a specific year; |
| 126 | /// - a year number, referring to a specific year. |
| 127 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 128 | pub enum Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year# { |
| 129 | /// The minimum year possible: `min` or `minimum`. |
| 130 | Minimumrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Minimum#, |
| 131 | /// The maximum year possible: `max` or `maximum`. |
| 132 | Maximumrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Maximum#, |
| 133 | /// A specific year number. |
| 134 | Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(i64), |
| 135 | } |
| 136 | |
| 137 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year# { |
| 138 | type Errrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Year][FromStr]Err# = Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#; |
| 139 | |
| 140 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Year][FromStr]from_str().(input: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Year][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> { |
| 141 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().input.to_ascii_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_ascii_lowercase().() { |
| 142 | "min" | "minimum" => Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Minimumrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Minimum#, |
| 143 | "max" | "maximum" => Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Maximumrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Maximum#, |
| 144 | year => match year.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().() { |
| 145 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(year) => Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(year), |
| 146 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(_) => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::FailedYearParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedYearParse#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 147 | }, |
| 148 | }) |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | /// A **month** field, which is actually just a wrapper around |
| 153 | /// `datetime::Month`. |
| 154 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 155 | pub enum Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month# { |
| 156 | Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January# = 1, |
| 157 | Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February# = 2, |
| 158 | Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March# = 3, |
| 159 | Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April# = 4, |
| 160 | Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May# = 5, |
| 161 | Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June# = 6, |
| 162 | Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July# = 7, |
| 163 | Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August# = 8, |
| 164 | Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September# = 9, |
| 165 | Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October# = 10, |
| 166 | Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November# = 11, |
| 167 | Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December# = 12, |
| 168 | } |
| 169 | |
| 170 | impl Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month# { |
| 171 | fn lengthrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]length().(self, is_leap: bool) -> i8 { |
| 172 | match self { |
| 173 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January# => 31, |
| 174 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February# if is_leap => 29, |
| 175 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February# => 28, |
| 176 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March# => 31, |
| 177 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April# => 30, |
| 178 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May# => 31, |
| 179 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June# => 30, |
| 180 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July# => 31, |
| 181 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August# => 31, |
| 182 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September# => 30, |
| 183 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October# => 31, |
| 184 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November# => 30, |
| 185 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December# => 31, |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | /// Get the next calendar month, with an error going from Dec->Jan |
| 190 | fn next_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]next_in_year().(self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, &'static str> { |
| 191 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match self { |
| 192 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, |
| 193 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#, |
| 194 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, |
| 195 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#, |
| 196 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#, |
| 197 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#, |
| 198 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#, |
| 199 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#, |
| 200 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, |
| 201 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#, |
| 202 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#, |
| 203 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#("Cannot wrap year from dec->jan")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 204 | }) |
| 205 | } |
| 206 | |
| 207 | /// Get the previous calendar month, with an error going from Jan->Dec |
| 208 | fn prev_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]prev_in_year().(self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, &'static str> { |
| 209 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match self { |
| 210 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#("Cannot wrap years from jan->dec")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 211 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January#, |
| 212 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, |
| 213 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#, |
| 214 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, |
| 215 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#, |
| 216 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#, |
| 217 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#, |
| 218 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#, |
| 219 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#, |
| 220 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, |
| 221 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December# => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#, |
| 222 | }) |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month# { |
| 227 | type Errrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month][FromStr]Err# = Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#; |
| 228 | |
| 229 | /// Attempts to parse the given string into a value of this type. |
| 230 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month][FromStr]from_str().(input: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> { |
| 231 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().input.to_ascii_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_ascii_lowercase().() { |
| 232 | "jan" | "january" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January#, |
| 233 | "feb" | "february" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, |
| 234 | "mar" | "march" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#, |
| 235 | "apr" | "april" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, |
| 236 | "may" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#, |
| 237 | "jun" | "june" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#, |
| 238 | "jul" | "july" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#, |
| 239 | "aug" | "august" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#, |
| 240 | "sep" | "september" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#, |
| 241 | "oct" | "october" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, |
| 242 | "nov" | "november" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#, |
| 243 | "dec" | "december" => Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#, |
| 244 | other => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::FailedMonthParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedMonthParse#(other.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 245 | }) |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /// A **weekday** field, which is actually just a wrapper around |
| 250 | /// `datetime::Weekday`. |
| 251 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 252 | pub enum Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday# { |
| 253 | Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#, |
| 254 | Mondayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Monday#, |
| 255 | Tuesdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Tuesday#, |
| 256 | Wednesdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Wednesday#, |
| 257 | Thursdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Thursday#, |
| 258 | Fridayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Friday#, |
| 259 | Saturdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Saturday#, |
| 260 | } |
| 261 | |
| 262 | impl Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday# { |
| 263 | fn calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(year: i64, month: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, day: i8) -> Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday# { |
| 264 | let m = month as i64; |
| 265 | let y = if m rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]lt().3 { year rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().1 } else { year }; |
| 266 | let d = day as i64; |
| 267 | const Trust-analyzer cargo parse-zoneinfo 0.5.0 line/T.: [i64; 12] = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; |
| 268 | match (y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div().4 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div().100 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Div<Self>`]div().400 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().Trust-analyzer cargo parse-zoneinfo 0.5.0 line/T.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().m as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().d) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Rem<Self>`]rem().7 { |
| 269 | 0 => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#, |
| 270 | 1 => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Mondayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Monday#, |
| 271 | 2 => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Tuesdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Tuesday#, |
| 272 | 3 => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Wednesdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Wednesday#, |
| 273 | 4 => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Thursdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Thursday#, |
| 274 | 5 => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Fridayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Friday#, |
| 275 | 6 => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Saturdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Saturday#, |
| 276 | _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("why is negative modulus designed so?"), |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday# { |
| 282 | type Errrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][FromStr]Err# = Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#; |
| 283 | |
| 284 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][FromStr]from_str().(input: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#, Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> { |
| 285 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().input.to_ascii_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_ascii_lowercase().() { |
| 286 | "mon" | "monday" => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Mondayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Monday#, |
| 287 | "tue" | "tuesday" => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Tuesdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Tuesday#, |
| 288 | "wed" | "wednesday" => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Wednesdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Wednesday#, |
| 289 | "thu" | "thursday" => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Thursdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Thursday#, |
| 290 | "fri" | "friday" => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Fridayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Friday#, |
| 291 | "sat" | "saturday" => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Saturdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Saturday#, |
| 292 | "sun" | "sunday" => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#, |
| 293 | other => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::FailedWeekdayParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedWeekdayParse#(other.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 294 | }) |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | /// A **day** definition field. |
| 299 | /// |
| 300 | /// This can be given in either absolute terms (such as “the fifth day of the |
| 301 | /// month”), or relative terms (such as “the last Sunday of the month”, or |
| 302 | /// “the last Friday before or including the 13th”). |
| 303 | /// |
| 304 | /// Note that in the last example, it’s allowed for that particular Friday to |
| 305 | /// *be* the 13th in question. |
| 306 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 307 | pub enum DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec# { |
| 308 | /// A specific day of the month, given by its number. |
| 309 | Ordinalrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Ordinal#(i8), |
| 310 | /// The last day of the month with a specific weekday. |
| 311 | Lastrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Last#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#), |
| 312 | /// The **last** day with the given weekday **before** (or including) a |
| 313 | /// day with a specific number. |
| 314 | LastOnOrBeforerust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#LastOnOrBefore#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#, i8), |
| 315 | /// The **first** day with the given weekday **after** (or including) a |
| 316 | /// day with a specific number. |
| 317 | FirstOnOrAfterrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#FirstOnOrAfter#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#, i8), |
| 318 | } |
| 319 | |
| 320 | impl DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec# { |
| 321 | /// Converts this day specification to a concrete date, given the year and |
| 322 | /// month it should occur in. |
| 323 | pub fn to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(&self, year: i64, month: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#) -> (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, i8) { |
| 324 | let leap = is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(year); |
| 325 | let length = month.lengthrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]length().(leap); |
| 326 | // we will never hit the 0 because we unwrap prev_in_year below |
| 327 | let prev_length = month.prev_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]prev_in_year().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|m| m.lengthrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]length().(leap)).unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or().(0); |
| 328 | |
| 329 | match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self { |
| 330 | DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Ordinalrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Ordinal#(day) => (month, day), |
| 331 | DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Lastrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Last#(weekday) => ( |
| 332 | month, |
| 333 | (1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#length rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().1) |
| 334 | .revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().() |
| 335 | .findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/rev/impl#[`Rev<I>`][Iterator]find().(|&day| Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(year, month, day) rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().==rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq(). rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().weekday) |
| 336 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), |
| 337 | ), |
| 338 | DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::LastOnOrBeforerust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#LastOnOrBefore#(weekday, day) => (-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().7..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().1) |
| 339 | .revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().() |
| 340 | .flat_maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flat_map().(|inner_day| { |
| 341 | if inner_day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]ge().1 && Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(year, month, inner_day) rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().==rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq(). rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().weekday { |
| 342 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((month, inner_day)) |
| 343 | } else if inner_day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]lt().1 |
| 344 | && Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().( |
| 345 | year, |
| 346 | month.prev_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]prev_in_year().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 347 | prev_length rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().inner_day, |
| 348 | ) rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().==rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq(). rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().weekday |
| 349 | { |
| 350 | // inner_day is negative, so this is subtraction |
| 351 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((month.prev_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]prev_in_year().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), prev_length rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().inner_day)) |
| 352 | } else { |
| 353 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 354 | } |
| 355 | }) |
| 356 | .nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/flatten/impl#[`FlatMap<I, U, F>`][Iterator]next().() |
| 357 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), |
| 358 | DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::FirstOnOrAfterrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#FirstOnOrAfter#(weekday, day) => (day..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Add<Self>`]add().8) |
| 359 | .flat_maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flat_map().(|inner_day| { |
| 360 | if inner_day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]le().length && Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(year, month, inner_day) rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().==rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq(). rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().weekday |
| 361 | { |
| 362 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((month, inner_day)) |
| 363 | } else if inner_day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i8][`PartialOrd<Self>`]gt().length |
| 364 | && Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().( |
| 365 | year, |
| 366 | month.next_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]next_in_year().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 367 | inner_day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub().length, |
| 368 | ) rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().==rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq(). rust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][`PartialEq<Self>`]eq().weekday |
| 369 | { |
| 370 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((month.next_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month]next_in_year().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), inner_day rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub().length)) |
| 371 | } else { |
| 372 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 373 | } |
| 374 | }) |
| 375 | .nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/flatten/impl#[`FlatMap<I, U, F>`][Iterator]next().() |
| 376 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec# { |
| 382 | type Errrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec][FromStr]Err# = Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#; |
| 383 | |
| 384 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec][FromStr]from_str().(input: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec][FromStr], Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> { |
| 385 | // Parse the field as a number if it vaguely resembles one. |
| 386 | if input.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().allrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#all().(|c| c.is_ascii_digitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_digit().()) { |
| 387 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Ordinalrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Ordinal#(input.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().())); |
| 388 | } |
| 389 | // Check if it starts with ‘last’, and trim off the first four bytes if it does |
| 390 | else if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(remainder) = input.strip_prefixrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]strip_prefix().("last") { |
| 391 | let weekday = remainder.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 392 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Lastrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Last#(weekday)); |
| 393 | } |
| 394 | |
| 395 | let weekday = match input.getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]get().(..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#3) { |
| 396 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(wd) => Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday][FromStr]from_str().(wd)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 397 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidDaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidDaySpec#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 398 | }; |
| 399 | |
| 400 | let dir = match input.getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]get().(3..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#5) { |
| 401 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(">=") => true, |
| 402 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#("<=") => false, |
| 403 | _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidDaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidDaySpec#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 404 | }; |
| 405 | |
| 406 | let day = match input.getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]get().(5..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#) { |
| 407 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(day) => u8::from_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8][FromStr]from_str().(day).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidDaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidDaySpec#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 408 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidDaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidDaySpec#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 409 | } as i8; |
| 410 | |
| 411 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match dir { |
| 412 | true => DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::FirstOnOrAfterrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#FirstOnOrAfter#(weekday, day), |
| 413 | false => DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::LastOnOrBeforerust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#LastOnOrBefore#(weekday, day), |
| 414 | }) |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | fn is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(year: i64) -> bool { |
| 419 | // Leap year rules: years which are factors of 4, except those divisible |
| 420 | // by 100, unless they are divisible by 400. |
| 421 | // |
| 422 | // We test most common cases first: 4th year, 100th year, then 400th year. |
| 423 | // |
| 424 | // We factor out 4 from 100 since it was already tested, leaving us checking |
| 425 | // if it's divisible by 25. Afterwards, we do the same, factoring 25 from |
| 426 | // 400, leaving us with 16. |
| 427 | // |
| 428 | // Factors of 4 and 16 can quickly be found with bitwise AND. |
| 429 | year rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAnd<Self>`]bitand().3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().0 && (year rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Rem<Self>`]rem().25 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().0 || year rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAnd<Self>`]bitand().15 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().0) |
| 430 | } |
| 431 | |
| 432 | /// A **time** definition field. |
| 433 | /// |
| 434 | /// A time must have an hours component, with optional minutes and seconds |
| 435 | /// components. It can also be negative with a starting ‘-’. |
| 436 | /// |
| 437 | /// Hour 0 is midnight at the start of the day, and Hour 24 is midnight at the |
| 438 | /// end of the day. |
| 439 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 440 | pub enum TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec# { |
| 441 | /// A number of hours. |
| 442 | Hoursrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Hours#(i8), |
| 443 | /// A number of hours and minutes. |
| 444 | HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(i8, i8), |
| 445 | /// A number of hours, minutes, and seconds. |
| 446 | HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(i8, i8, i8), |
| 447 | /// Zero, or midnight at the start of the day. |
| 448 | Zerorust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Zero#, |
| 449 | } |
| 450 | |
| 451 | impl TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec# { |
| 452 | /// Returns the number of seconds past midnight that this time spec |
| 453 | /// represents. |
| 454 | pub fn as_secondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec]as_seconds().(self) -> i64 { |
| 455 | match self { |
| 456 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Hoursrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Hours#(h) => h as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60, |
| 457 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(h, m) => h as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().m as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60, |
| 458 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(h, m, s) => h as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().m as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().s as i64, |
| 459 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Zerorust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Zero# => 0, |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | pub fn with_typerust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec]with_type().(self, timetype: TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#) -> TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType# { |
| 464 | TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#(self, timetype) |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec# { |
| 469 | type Errrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]Err# = Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#; |
| 470 | |
| 471 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]from_str().(input: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr], Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> { |
| 472 | if input rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq()."-" { |
| 473 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Zerorust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Zero#); |
| 474 | } |
| 475 | |
| 476 | let neg = if input.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('-') { -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().1 } else { 1 }; |
| 477 | let mut state = TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Zerorust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Zero#; |
| 478 | for part in input.splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().(':') { |
| 479 | state = match (state, part) { |
| 480 | (TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Zerorust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Zero#, hour) => TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Hoursrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Hours#( |
| 481 | i8::from_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i8][FromStr]from_str().(hour) |
| 482 | .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidTimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidTimeSpecAndType#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 483 | ), |
| 484 | (TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Hoursrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Hours#(hours), minutes) if minutes.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().2 => TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#( |
| 485 | hours, |
| 486 | i8::from_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i8][FromStr]from_str().(minutes) |
| 487 | .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidTimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidTimeSpecAndType#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 488 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Mul<Self>`]mul().neg, |
| 489 | ), |
| 490 | (TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(hours, minutes), seconds) if seconds.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().2 => { |
| 491 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#( |
| 492 | hours, |
| 493 | minutes, |
| 494 | i8::from_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i8][FromStr]from_str().(seconds) |
| 495 | .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidTimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidTimeSpecAndType#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 496 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Mul<Self>`]mul().neg, |
| 497 | ) |
| 498 | } |
| 499 | _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidTimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidTimeSpecAndType#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 500 | }; |
| 501 | } |
| 502 | |
| 503 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(state) |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 508 | pub enum TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType# { |
| 509 | Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#, |
| 510 | Standardrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Standard#, |
| 511 | UTCrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#UTC#, |
| 512 | } |
| 513 | |
| 514 | impl TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType# { |
| 515 | fn from_charrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeType]from_char().(c: char) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeType]> { |
| 516 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(match c { |
| 517 | 'w' => Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeType]::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#, |
| 518 | 's' => Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeType]::Standardrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Standard#, |
| 519 | 'u' | 'g' | 'z' => Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeType]::UTCrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#UTC#, |
| 520 | _ => return Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 521 | }) |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 526 | pub struct TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#(pub TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, pub TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#); |
| 527 | |
| 528 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType# { |
| 529 | type Errrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpecAndType][FromStr]Err# = Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#; |
| 530 | |
| 531 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpecAndType][FromStr]from_str().(input: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpecAndType][FromStr], Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpecAndType][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> { |
| 532 | if input rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq()."-" { |
| 533 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#(TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Zerorust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Zero#, TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#)); |
| 534 | } else if input.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().allrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#all().(|c| c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'-' || c.is_ascii_digitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_digit().()) { |
| 535 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#(TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]from_str().(input)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#)); |
| 536 | } |
| 537 | |
| 538 | let (input, ty) = match input.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().lastrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]last().().and_thenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]and_then().(TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::from_charrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeType]from_char().) { |
| 539 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ty) => (&input[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#input.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ty)), |
| 540 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => (input, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), |
| 541 | }; |
| 542 | |
| 543 | let spec = TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]from_str().(input)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 544 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#(spec, ty.unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or().(TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#))) |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | /// The time at which the rules change for a location. |
| 549 | /// |
| 550 | /// This is described with as few units as possible: a change that occurs at |
| 551 | /// the beginning of the year lists only the year, a change that occurs on a |
| 552 | /// particular day has to list the year, month, and day, and one that occurs |
| 553 | /// at a particular second has to list everything. |
| 554 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 555 | pub enum ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime# { |
| 556 | /// The earliest point in a particular **year**. |
| 557 | UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#), |
| 558 | /// The earliest point in a particular **month**. |
| 559 | UntilMonthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilMonth#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#), |
| 560 | /// The earliest point in a particular **day**. |
| 561 | UntilDayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilDay#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#), |
| 562 | /// The earliest point in a particular **hour, minute, or second**. |
| 563 | UntilTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilTime#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#, TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#), |
| 564 | } |
| 565 | |
| 566 | impl ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime# { |
| 567 | /// Convert this change time to an absolute timestamp, as the number of |
| 568 | /// seconds since the Unix epoch that the change occurs at. |
| 569 | pub fn to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[ChangeTime]to_timestamp().(&self, utc_offset: i64, dst_offset: i64) -> i64 { |
| 570 | fn seconds_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/seconds_in_year().(year: i64) -> i64 { |
| 571 | if is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(year) { |
| 572 | 366 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().24 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 |
| 573 | } else { |
| 574 | 365 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().24 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | fn seconds_until_start_of_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/seconds_until_start_of_year().(year: i64) -> i64 { |
| 579 | if year rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().1970 { |
| 580 | (1970..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#year).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(seconds_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/seconds_in_year().).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().() |
| 581 | } else { |
| 582 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][Neg]neg().(year..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#1970).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(seconds_in_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/seconds_in_year().).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().::<i64>() |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | fn time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().( |
| 587 | year: i64, |
| 588 | month: i8, |
| 589 | day: i8, |
| 590 | hour: i8, |
| 591 | minute: i8, |
| 592 | second: i8, |
| 593 | ) -> i64 { |
| 594 | const MONTHS_NON_LEAPrust-analyzer cargo parse-zoneinfo 0.5.0 line/MONTHS_NON_LEAP.: [i64; 12] = [ |
| 595 | 0, |
| 596 | 31, |
| 597 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28, |
| 598 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 599 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 600 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 601 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 602 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 603 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 604 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 605 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 606 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().28 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 607 | ]; |
| 608 | const MONTHS_LEAPrust-analyzer cargo parse-zoneinfo 0.5.0 line/MONTHS_LEAP.: [i64; 12] = [ |
| 609 | 0, |
| 610 | 31, |
| 611 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29, |
| 612 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 613 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 614 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 615 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 616 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 617 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 618 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 619 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31, |
| 620 | 31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().29 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().31 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().30, |
| 621 | ]; |
| 622 | seconds_until_start_of_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/seconds_until_start_of_year().(year) |
| 623 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 |
| 624 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().24 |
| 625 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().if is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(year) { |
| 626 | MONTHS_LEAPrust-analyzer cargo parse-zoneinfo 0.5.0 line/MONTHS_LEAP.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().month as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). |
| 627 | } else { |
| 628 | MONTHS_NON_LEAPrust-analyzer cargo parse-zoneinfo 0.5.0 line/MONTHS_NON_LEAP.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().month as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). |
| 629 | } |
| 630 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().24 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().(day as i64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().1) |
| 631 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().hour as i64 |
| 632 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul().minute as i64 |
| 633 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().second as i64 |
| 634 | } |
| 635 | |
| 636 | match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self { |
| 637 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y)) => { |
| 638 | time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().(y, 1, 1, 0, 0, 0) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().(utc_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().dst_offset) |
| 639 | } |
| 640 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilMonthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilMonth#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y), m) => { |
| 641 | time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().(y, m as i8, 1, 0, 0, 0) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().(utc_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().dst_offset) |
| 642 | } |
| 643 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilDayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilDay#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y), m, d) => { |
| 644 | let (m, wd) = d.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(y, m); |
| 645 | time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().(y, m as i8, wd, 0, 0, 0) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().(utc_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().dst_offset) |
| 646 | } |
| 647 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilTime#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y), m, d, time) => { |
| 648 | (match time.0rust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#0. { |
| 649 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Zerorust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Zero# => { |
| 650 | let (m, wd) = d.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(y, m); |
| 651 | time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().(y, m as i8, wd, 0, 0, 0) |
| 652 | } |
| 653 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Hoursrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Hours#(h) => { |
| 654 | let (m, wd) = d.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(y, m); |
| 655 | time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().(y, m as i8, wd, h, 0, 0) |
| 656 | } |
| 657 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(h, min) => { |
| 658 | let (m, wd) = d.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(y, m); |
| 659 | time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().(y, m as i8, wd, h, min, 0) |
| 660 | } |
| 661 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(h, min, s) => { |
| 662 | let (m, wd) = d.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(y, m); |
| 663 | time_to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/time_to_timestamp().(y, m as i8, wd, h, min, s) |
| 664 | } |
| 665 | }) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().match time.1rust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#1. { |
| 666 | TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::UTCrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#UTC# => 0, |
| 667 | TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Standardrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Standard# => utc_offset, |
| 668 | TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall# => utc_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add().dst_offset, |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 673 | } |
| 674 | } |
| 675 | |
| 676 | pub fn yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[ChangeTime]year().(&self) -> i64 { |
| 677 | match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self { |
| 678 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y)) => y, |
| 679 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilMonthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilMonth#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y), ..) => y, |
| 680 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilDayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilDay#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y), ..) => y, |
| 681 | ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilTime#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(y), ..) => y, |
| 682 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 683 | } |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | /// The information contained in both zone lines *and* zone continuation lines. |
| 688 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 689 | pub struct ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#<'a> { |
| 690 | /// The amount of time that needs to be added to UTC to get the standard |
| 691 | /// time in this zone. |
| 692 | pub utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 693 | /// The name of all the rules that should apply in the time zone, or the |
| 694 | /// amount of time to add. |
| 695 | pub savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a>, |
| 696 | /// The format for time zone abbreviations, with `%s` as the string marker. |
| 697 | pub formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format.: &'a str, |
| 698 | /// The time at which the rules change for this location, or `None` if |
| 699 | /// these rules are in effect until the end of time (!). |
| 700 | pub timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#>, |
| 701 | } |
| 702 | |
| 703 | impl<'a> ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#<'a> { |
| 704 | fn from_iterrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`]from_iter().(iter: impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a str>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`], Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#> { |
| 705 | let mut state = ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Startrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Start#; |
| 706 | for part in iter { |
| 707 | state = match (state, part) { |
| 708 | // In theory a comment is allowed to come after a field without preceding |
| 709 | // whitespace, but this doesn't seem to be used in practice. |
| 710 | (st, _) if part.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('#') => { |
| 711 | state = st; |
| 712 | break; |
| 713 | } |
| 714 | (ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Startrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Start#, offset) => ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Saverust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Save# { |
| 715 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Save#offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]from_str().(offset)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 716 | }, |
| 717 | (ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Saverust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Save# { offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Save#offset. }, saving) => ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format# { |
| 718 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format#offset., |
| 719 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Saving<'a>`]from_str().(saving)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 720 | }, |
| 721 | (ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format# { offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format#offset., savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format#saving. }, format) => ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year# { |
| 722 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#offset., |
| 723 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#saving., |
| 724 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#format., |
| 725 | }, |
| 726 | ( |
| 727 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year# { |
| 728 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#offset., |
| 729 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#saving., |
| 730 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#format., |
| 731 | }, |
| 732 | year, |
| 733 | ) => ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month# { |
| 734 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#offset., |
| 735 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#saving., |
| 736 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#format., |
| 737 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Year][FromStr]from_str().(year)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 738 | }, |
| 739 | ( |
| 740 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month# { |
| 741 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#offset., |
| 742 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#saving., |
| 743 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#format., |
| 744 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#year., |
| 745 | }, |
| 746 | month, |
| 747 | ) => ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day# { |
| 748 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#offset., |
| 749 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#saving., |
| 750 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#format., |
| 751 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#year., |
| 752 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month][FromStr]from_str().(month)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 753 | }, |
| 754 | ( |
| 755 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day# { |
| 756 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#offset., |
| 757 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#saving., |
| 758 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#format., |
| 759 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#year., |
| 760 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#month., |
| 761 | }, |
| 762 | day, |
| 763 | ) => ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time# { |
| 764 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#offset., |
| 765 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#saving., |
| 766 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#format., |
| 767 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#year., |
| 768 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#month., |
| 769 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec][FromStr]from_str().(day)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 770 | }, |
| 771 | ( |
| 772 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time# { |
| 773 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#offset., |
| 774 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#saving., |
| 775 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#format., |
| 776 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#year., |
| 777 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#month., |
| 778 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#day., |
| 779 | }, |
| 780 | time, |
| 781 | ) => { |
| 782 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`] { |
| 783 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: offset, |
| 784 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving., |
| 785 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format., |
| 786 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilTime#( |
| 787 | year, |
| 788 | month, |
| 789 | day, |
| 790 | TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpecAndType][FromStr]from_str().(time)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 791 | )), |
| 792 | }) |
| 793 | } |
| 794 | }; |
| 795 | } |
| 796 | |
| 797 | match state { |
| 798 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Startrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Start# | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Saverust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Save# { .. } | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format# { .. } => { |
| 799 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsZoneLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsZoneLine#) |
| 800 | } |
| 801 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year# { |
| 802 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#offset., |
| 803 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#saving., |
| 804 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#format., |
| 805 | } => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`] { |
| 806 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: offset, |
| 807 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving., |
| 808 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format., |
| 809 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 810 | }), |
| 811 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month# { |
| 812 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#offset., |
| 813 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#saving., |
| 814 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#format., |
| 815 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#year., |
| 816 | } => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`] { |
| 817 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: offset, |
| 818 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving., |
| 819 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format., |
| 820 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(year)), |
| 821 | }), |
| 822 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day# { |
| 823 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#offset., |
| 824 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#saving., |
| 825 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#format., |
| 826 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#year., |
| 827 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#month., |
| 828 | } => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`] { |
| 829 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: offset, |
| 830 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving., |
| 831 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format., |
| 832 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilMonthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilMonth#(year, month)), |
| 833 | }), |
| 834 | ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#::Timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time# { |
| 835 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#offset., |
| 836 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#saving., |
| 837 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#format., |
| 838 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#year., |
| 839 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#month., |
| 840 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#day., |
| 841 | } => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`] { |
| 842 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: offset, |
| 843 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving., |
| 844 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format., |
| 845 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilDayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilDay#(year, month, day)), |
| 846 | }), |
| 847 | } |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | enum ZoneInfoStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#<'a> { |
| 852 | Startrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Start#, |
| 853 | Saverust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Save# { |
| 854 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Save#offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 855 | }, |
| 856 | Formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format# { |
| 857 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format#offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 858 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Format#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a>, |
| 859 | }, |
| 860 | Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year# { |
| 861 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 862 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a>, |
| 863 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Year#format.: &'a str, |
| 864 | }, |
| 865 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month# { |
| 866 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 867 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a>, |
| 868 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#format.: &'a str, |
| 869 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Month#year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 870 | }, |
| 871 | Dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day# { |
| 872 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 873 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a>, |
| 874 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#format.: &'a str, |
| 875 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 876 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Day#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, |
| 877 | }, |
| 878 | Timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time# { |
| 879 | offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 880 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a>, |
| 881 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#format.: &'a str, |
| 882 | yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 883 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, |
| 884 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfoState#Time#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#, |
| 885 | }, |
| 886 | } |
| 887 | |
| 888 | /// The amount of daylight saving time (DST) to apply to this timespan. This |
| 889 | /// is a special type for a certain field in a zone line, which can hold |
| 890 | /// different types of value. |
| 891 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 892 | pub enum Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a> { |
| 893 | /// Just stick to the base offset. |
| 894 | NoSavingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#NoSaving#, |
| 895 | /// This amount of time should be saved while this timespan is in effect. |
| 896 | /// (This is the equivalent to there being a single one-off rule with the |
| 897 | /// given amount of time to save). |
| 898 | OneOffrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#OneOff#(TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#), |
| 899 | /// All rules with the given name should apply while this timespan is in |
| 900 | /// effect. |
| 901 | Multiplerust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#Multiple#(&'a str), |
| 902 | } |
| 903 | |
| 904 | impl<'a> Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#<'a> { |
| 905 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Saving<'a>`]from_str().(input: &'a str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Saving<'a>`], Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#> { |
| 906 | if input rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq()."-" { |
| 907 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Saving<'a>`]::NoSavingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#NoSaving#) |
| 908 | } else if input |
| 909 | .charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().() |
| 910 | .allrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#all().(|c| c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'-' || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'_' || c.is_alphabeticrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_alphabetic().()) |
| 911 | { |
| 912 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Saving<'a>`]::Multiplerust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#Multiple#(input)) |
| 913 | } else if let Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(time) = TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]from_str().(input) { |
| 914 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Saving<'a>`]::OneOffrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#OneOff#(time)) |
| 915 | } else { |
| 916 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::CouldNotParseSavingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#CouldNotParseSaving#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())) |
| 917 | } |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | /// A **rule** definition line. |
| 922 | /// |
| 923 | /// According to the `zic(8)` man page, a rule line has this form, along with |
| 924 | /// an example: |
| 925 | /// |
| 926 | /// ```text |
| 927 | /// Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S |
| 928 | /// Rule US 1967 1973 ‐ Apr lastSun 2:00 1:00 D |
| 929 | /// ``` |
| 930 | /// |
| 931 | /// Apart from the opening `Rule` to specify which kind of line this is, and |
| 932 | /// the `type` column, every column in the line has a field in this struct. |
| 933 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 934 | pub struct Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#<'a> { |
| 935 | /// The name of the set of rules that this rule is part of. |
| 936 | pub namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#name.: &'a str, |
| 937 | /// The first year in which the rule applies. |
| 938 | pub from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 939 | /// The final year, or `None` if’s ‘only’. |
| 940 | pub to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#to_year.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#>, |
| 941 | /// The month in which the rule takes effect. |
| 942 | pub monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, |
| 943 | /// The day on which the rule takes effect. |
| 944 | pub dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#, |
| 945 | /// The time of day at which the rule takes effect. |
| 946 | pub timerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time.: TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#, |
| 947 | /// The amount of time to be added when the rule is in effect. |
| 948 | pub time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time_to_add.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 949 | /// The variable part of time zone abbreviations to be used when this rule |
| 950 | /// is in effect, if any. |
| 951 | pub lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#letters.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&'a str>, |
| 952 | } |
| 953 | |
| 954 | impl<'a> Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#<'a> { |
| 955 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Rule<'a>`]from_str().(input: &'a str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Rule<'a>`], Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#> { |
| 956 | let mut state = RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Startrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Start#; |
| 957 | // Not handled: quoted strings, parts of which are allowed to contain whitespace. |
| 958 | // Extra complexity does not seem worth it while they don't seem to be used in practice. |
| 959 | for part in input.split_ascii_whitespacerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_ascii_whitespace().() { |
| 960 | if part.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('#') { |
| 961 | continue; |
| 962 | } |
| 963 | |
| 964 | state = match (state, part) { |
| 965 | (RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Startrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Start#, "Rule") => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Name#, |
| 966 | (RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Name#, name) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::FromYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#FromYear# { namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#FromYear#name. }, |
| 967 | (RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::FromYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#FromYear# { namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#FromYear#name. }, year) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::ToYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear# { |
| 968 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear#name., |
| 969 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Year][FromStr]from_str().(year)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 970 | }, |
| 971 | (RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::ToYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear# { namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear#name., from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear#from_year. }, year) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Typerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type# { |
| 972 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#name., |
| 973 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#from_year., |
| 974 | // The end year can be ‘only’ to indicate that this rule only |
| 975 | // takes place on that year. |
| 976 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#to_year.: match year { |
| 977 | "only" => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 978 | _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Year][FromStr]from_str().(year)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().), |
| 979 | }, |
| 980 | }, |
| 981 | // According to the spec, the only value inside the ‘type’ column |
| 982 | // should be “-”, so throw an error if it isn’t. (It only exists |
| 983 | // for compatibility with old versions that used to contain year |
| 984 | // types.) Sometimes “‐”, a Unicode hyphen, is used as well. |
| 985 | ( |
| 986 | RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Typerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type# { |
| 987 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#name., |
| 988 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#from_year., |
| 989 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#to_year., |
| 990 | }, |
| 991 | "-" | "\u{2010}", |
| 992 | ) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month# { |
| 993 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#name., |
| 994 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#from_year., |
| 995 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#to_year., |
| 996 | }, |
| 997 | (RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Typerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type# { .. }, _) => { |
| 998 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::TypeColumnContainedNonHyphenrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#TypeColumnContainedNonHyphen#(part.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())) |
| 999 | } |
| 1000 | ( |
| 1001 | RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month# { |
| 1002 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#name., |
| 1003 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#from_year., |
| 1004 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#to_year., |
| 1005 | }, |
| 1006 | month, |
| 1007 | ) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day# { |
| 1008 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#name., |
| 1009 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#from_year., |
| 1010 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#to_year., |
| 1011 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month][FromStr]from_str().(month)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1012 | }, |
| 1013 | ( |
| 1014 | RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day# { |
| 1015 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#name., |
| 1016 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#from_year., |
| 1017 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#to_year., |
| 1018 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#month., |
| 1019 | }, |
| 1020 | day, |
| 1021 | ) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time# { |
| 1022 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#name., |
| 1023 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#from_year., |
| 1024 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#to_year., |
| 1025 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#month., |
| 1026 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec][FromStr]from_str().(day)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1027 | }, |
| 1028 | ( |
| 1029 | RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time# { |
| 1030 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#name., |
| 1031 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#from_year., |
| 1032 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#to_year., |
| 1033 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#month., |
| 1034 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#day., |
| 1035 | }, |
| 1036 | time, |
| 1037 | ) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::TimeToAddrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd# { |
| 1038 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#name., |
| 1039 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#from_year., |
| 1040 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#to_year., |
| 1041 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#month., |
| 1042 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#day., |
| 1043 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#time.: TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpecAndType][FromStr]from_str().(time)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1044 | }, |
| 1045 | ( |
| 1046 | RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::TimeToAddrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd# { |
| 1047 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#name., |
| 1048 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#from_year., |
| 1049 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#to_year., |
| 1050 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#month., |
| 1051 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#day., |
| 1052 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#time., |
| 1053 | }, |
| 1054 | time_to_add, |
| 1055 | ) => RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters# { |
| 1056 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#name., |
| 1057 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#from_year., |
| 1058 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#to_year., |
| 1059 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#month., |
| 1060 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#day., |
| 1061 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#time., |
| 1062 | time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#time_to_add.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec][FromStr]from_str().(time_to_add)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1063 | }, |
| 1064 | ( |
| 1065 | RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#::Lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters# { |
| 1066 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#name., |
| 1067 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#from_year., |
| 1068 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#to_year., |
| 1069 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#month., |
| 1070 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#day., |
| 1071 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#time., |
| 1072 | time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#time_to_add., |
| 1073 | }, |
| 1074 | letters, |
| 1075 | ) => { |
| 1076 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Rule<'a>`] { |
| 1077 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#name., |
| 1078 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#from_year., |
| 1079 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#to_year., |
| 1080 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#month., |
| 1081 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#day., |
| 1082 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time., |
| 1083 | time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time_to_add., |
| 1084 | lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#letters.: match letters { |
| 1085 | "-" => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1086 | _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(letters), |
| 1087 | }, |
| 1088 | }) |
| 1089 | } |
| 1090 | _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsRuleLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsRuleLine#), |
| 1091 | }; |
| 1092 | } |
| 1093 | |
| 1094 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsRuleLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsRuleLine#) |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | enum RuleStaterust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#<'a> { |
| 1099 | Startrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Start#, |
| 1100 | Namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Name#, |
| 1101 | FromYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#FromYear# { |
| 1102 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#FromYear#name.: &'a str, |
| 1103 | }, |
| 1104 | ToYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear# { |
| 1105 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear#name.: &'a str, |
| 1106 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#ToYear#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 1107 | }, |
| 1108 | Typerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type# { |
| 1109 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#name.: &'a str, |
| 1110 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 1111 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Type#to_year.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#>, |
| 1112 | }, |
| 1113 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month# { |
| 1114 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#name.: &'a str, |
| 1115 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 1116 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Month#to_year.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#>, |
| 1117 | }, |
| 1118 | Dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day# { |
| 1119 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#name.: &'a str, |
| 1120 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 1121 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#to_year.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#>, |
| 1122 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Day#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, |
| 1123 | }, |
| 1124 | Timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time# { |
| 1125 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#name.: &'a str, |
| 1126 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 1127 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#to_year.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#>, |
| 1128 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, |
| 1129 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Time#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#, |
| 1130 | }, |
| 1131 | TimeToAddrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd# { |
| 1132 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#name.: &'a str, |
| 1133 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 1134 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#to_year.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#>, |
| 1135 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, |
| 1136 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#, |
| 1137 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#TimeToAdd#time.: TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#, |
| 1138 | }, |
| 1139 | Lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters# { |
| 1140 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#name.: &'a str, |
| 1141 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#, |
| 1142 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#to_year.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#>, |
| 1143 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#, |
| 1144 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#, |
| 1145 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#time.: TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#, |
| 1146 | time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/RuleState#Letters#time_to_add.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#, |
| 1147 | }, |
| 1148 | } |
| 1149 | |
| 1150 | /// A **zone** definition line. |
| 1151 | /// |
| 1152 | /// According to the `zic(8)` man page, a zone line has this form, along with |
| 1153 | /// an example: |
| 1154 | /// |
| 1155 | /// ```text |
| 1156 | /// Zone NAME GMTOFF RULES/SAVE FORMAT [UNTILYEAR [MONTH [DAY [TIME]]]] |
| 1157 | /// Zone Australia/Adelaide 9:30 Aus AC%sT 1971 Oct 31 2:00 |
| 1158 | /// ``` |
| 1159 | /// |
| 1160 | /// The opening `Zone` identifier is ignored, and the last four columns are |
| 1161 | /// all optional, with their variants consolidated into a `ChangeTime`. |
| 1162 | /// |
| 1163 | /// The `Rules/Save` column, if it contains a value, *either* contains the |
| 1164 | /// name of the rules to use for this zone, *or* contains a one-off period of |
| 1165 | /// time to save. |
| 1166 | /// |
| 1167 | /// A continuation rule line contains all the same fields apart from the |
| 1168 | /// `Name` column and the opening `Zone` identifier. |
| 1169 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 1170 | pub struct Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#<'a> { |
| 1171 | /// The name of the time zone. |
| 1172 | pub namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#name.: &'a str, |
| 1173 | /// All the other fields of info. |
| 1174 | pub inforust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#info.: ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#<'a>, |
| 1175 | } |
| 1176 | |
| 1177 | impl<'a> Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#<'a> { |
| 1178 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Zone<'a>`]from_str().(input: &'a str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Zone<'a>`], Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#> { |
| 1179 | let mut iter = input.split_ascii_whitespacerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_ascii_whitespace().(); |
| 1180 | if iter.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`SplitAsciiWhitespace<'a>`][Iterator]next().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#("Zone") { |
| 1181 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsZoneLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsZoneLine#); |
| 1182 | } |
| 1183 | |
| 1184 | let name = match iter.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`SplitAsciiWhitespace<'a>`][Iterator]next().() { |
| 1185 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(name) => name, |
| 1186 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsZoneLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsZoneLine#), |
| 1187 | }; |
| 1188 | |
| 1189 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Zone<'a>`] { |
| 1190 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#name., |
| 1191 | inforust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#info.: ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#::from_iterrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`]from_iter().(iter)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1192 | }) |
| 1193 | } |
| 1194 | } |
| 1195 | |
| 1196 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 1197 | pub struct Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#<'a> { |
| 1198 | pub existingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#existing.: &'a str, |
| 1199 | pub newrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#new.: &'a str, |
| 1200 | } |
| 1201 | |
| 1202 | impl<'a> Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#<'a> { |
| 1203 | fn from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Link<'a>`]from_str().(input: &'a str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Link<'a>`], Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#> { |
| 1204 | let mut iter = input.split_ascii_whitespacerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_ascii_whitespace().(); |
| 1205 | if iter.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`SplitAsciiWhitespace<'a>`][Iterator]next().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#("Link") { |
| 1206 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsLinkLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsLinkLine#); |
| 1207 | } |
| 1208 | |
| 1209 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link# { |
| 1210 | existingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#existing.: iter.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`SplitAsciiWhitespace<'a>`][Iterator]next().().ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsLinkLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsLinkLine#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1211 | newrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#new.: iter.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`SplitAsciiWhitespace<'a>`][Iterator]next().().ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::NotParsedAsLinkLinerust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#NotParsedAsLinkLine#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1212 | }) |
| 1213 | } |
| 1214 | } |
| 1215 | |
| 1216 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 1217 | pub enum Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#<'a> { |
| 1218 | /// This line is empty. |
| 1219 | Spacerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Space#, |
| 1220 | /// This line contains a **zone** definition. |
| 1221 | Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Zone#(Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#<'a>), |
| 1222 | /// This line contains a **continuation** of a zone definition. |
| 1223 | Continuationrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Continuation#(ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#<'a>), |
| 1224 | /// This line contains a **rule** definition. |
| 1225 | Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Rule#(Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#<'a>), |
| 1226 | /// This line contains a **link** definition. |
| 1227 | Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Link#(Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#<'a>), |
| 1228 | } |
| 1229 | |
| 1230 | impl<'a> Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#<'a> { |
| 1231 | /// Attempt to parse this line, returning a `Line` depending on what |
| 1232 | /// type of line it was, or an `Error` if it couldn't be parsed. |
| 1233 | pub fn newrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Line<'a>`]new().(input: &'a str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#<'a>, Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#> { |
| 1234 | let input = match input.split_oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_once().('#') { |
| 1235 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((input, _)) => input, |
| 1236 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => input, |
| 1237 | }; |
| 1238 | |
| 1239 | if input.trimrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim().().is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() { |
| 1240 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Spacerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Space#); |
| 1241 | } |
| 1242 | |
| 1243 | if input.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().("Zone") { |
| 1244 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Zone#(Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Zone<'a>`]from_str().(input)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)); |
| 1245 | } |
| 1246 | |
| 1247 | if input.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().(&[' ', '\t'][rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().) { |
| 1248 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Continuationrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Continuation#(ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#::from_iterrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`ZoneInfo<'a>`]from_iter().( |
| 1249 | input.split_ascii_whitespacerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_ascii_whitespace().(), |
| 1250 | )?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)); |
| 1251 | } |
| 1252 | |
| 1253 | if input.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().("Rule") { |
| 1254 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Rule#(Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Rule<'a>`]from_str().(input)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)); |
| 1255 | } |
| 1256 | |
| 1257 | if input.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().("Link") { |
| 1258 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Link#(Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Link<'a>`]from_str().(input)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)); |
| 1259 | } |
| 1260 | |
| 1261 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidLineTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidLineType#(input.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())) |
| 1262 | } |
| 1263 | } |
| 1264 | |
| 1265 | #[cfg(test)] |
| 1266 | mod testsrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/ { |
| 1267 | use superrust-analyzer cargo parse-zoneinfo 0.5.0 line/::*; |
| 1268 | |
| 1269 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1270 | fn weekdaysrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/weekdays().() { |
| 1271 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1272 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(1970, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January#, 1), |
| 1273 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Thursdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Thursday# |
| 1274 | ); |
| 1275 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1276 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(2017, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, 11), |
| 1277 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Saturdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Saturday# |
| 1278 | ); |
| 1279 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(1890, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#, 2), Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#); |
| 1280 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(2100, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, 20), Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Tuesdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Tuesday#); |
| 1281 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(2009, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#, 31), Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#); |
| 1282 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(2001, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#, 9), Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Saturdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Saturday#); |
| 1283 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(1995, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#, 21), Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Fridayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Friday#); |
| 1284 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(1982, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#, 8), Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#); |
| 1285 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1286 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(1962, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#, 6), |
| 1287 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Thursdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Thursday# |
| 1288 | ); |
| 1289 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1290 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(1899, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, 14), |
| 1291 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Saturdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Saturday# |
| 1292 | ); |
| 1293 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1294 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#, 18), |
| 1295 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Fridayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Friday# |
| 1296 | ); |
| 1297 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1298 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(2010, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#, 19), |
| 1299 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday# |
| 1300 | ); |
| 1301 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1302 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::calculaterust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Weekday]calculate().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, 29), |
| 1303 | Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Mondayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Monday# |
| 1304 | ); |
| 1305 | } |
| 1306 | |
| 1307 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1308 | fn last_mondayrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/last_monday().() { |
| 1309 | let dayspec = DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Lastrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Last#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Mondayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Monday#); |
| 1310 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1311 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January#), |
| 1312 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January#, 25) |
| 1313 | ); |
| 1314 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1315 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#), |
| 1316 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, 29) |
| 1317 | ); |
| 1318 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1319 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#), |
| 1320 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#, 28) |
| 1321 | ); |
| 1322 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1323 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#), |
| 1324 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, 25) |
| 1325 | ); |
| 1326 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#), (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#, 30)); |
| 1327 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1328 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#), |
| 1329 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#, 27) |
| 1330 | ); |
| 1331 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1332 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#), |
| 1333 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#, 25) |
| 1334 | ); |
| 1335 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1336 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#), |
| 1337 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#, 29) |
| 1338 | ); |
| 1339 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1340 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#), |
| 1341 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#, 26) |
| 1342 | ); |
| 1343 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1344 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#), |
| 1345 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, 31) |
| 1346 | ); |
| 1347 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1348 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#), |
| 1349 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#, 28) |
| 1350 | ); |
| 1351 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1352 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#), |
| 1353 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#, 26) |
| 1354 | ); |
| 1355 | } |
| 1356 | |
| 1357 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1358 | fn first_monday_on_or_afterrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/first_monday_on_or_after().() { |
| 1359 | let dayspec = DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::FirstOnOrAfterrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#FirstOnOrAfter#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Mondayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Monday#, 20); |
| 1360 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1361 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January#), |
| 1362 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Januaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#January#, 25) |
| 1363 | ); |
| 1364 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1365 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#), |
| 1366 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, 22) |
| 1367 | ); |
| 1368 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1369 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#), |
| 1370 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#, 21) |
| 1371 | ); |
| 1372 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1373 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#), |
| 1374 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, 25) |
| 1375 | ); |
| 1376 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#), (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#, 23)); |
| 1377 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1378 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#), |
| 1379 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Junerust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#June#, 20) |
| 1380 | ); |
| 1381 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1382 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#), |
| 1383 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Julyrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#July#, 25) |
| 1384 | ); |
| 1385 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1386 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#), |
| 1387 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#, 22) |
| 1388 | ); |
| 1389 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1390 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#), |
| 1391 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Septemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#September#, 26) |
| 1392 | ); |
| 1393 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1394 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#), |
| 1395 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, 24) |
| 1396 | ); |
| 1397 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1398 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#), |
| 1399 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Novemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#November#, 21) |
| 1400 | ); |
| 1401 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1402 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2016, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#), |
| 1403 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#, 26) |
| 1404 | ); |
| 1405 | } |
| 1406 | |
| 1407 | // A couple of specific timezone transitions that we care about |
| 1408 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1409 | fn first_sunday_in_torontorust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/first_sunday_in_toronto().() { |
| 1410 | let dayspec = DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::FirstOnOrAfterrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#FirstOnOrAfter#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#, 25); |
| 1411 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(1932, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#), (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Mayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#May#, 1)); |
| 1412 | // asia/zion |
| 1413 | let dayspec = DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::LastOnOrBeforerust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#LastOnOrBefore#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Fridayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Friday#, 1); |
| 1414 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1415 | dayspec.to_concrete_dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[DaySpec]to_concrete_day().(2012, Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#), |
| 1416 | (Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Marchrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#March#, 30) |
| 1417 | ); |
| 1418 | } |
| 1419 | |
| 1420 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1421 | fn to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/to_timestamp().() { |
| 1422 | let time = ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1970)); |
| 1423 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(time.to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[ChangeTime]to_timestamp().(0, 0), 0); |
| 1424 | let time = ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(2016)); |
| 1425 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(time.to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[ChangeTime]to_timestamp().(0, 0), 1451606400); |
| 1426 | let time = ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1900)); |
| 1427 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(time.to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[ChangeTime]to_timestamp().(0, 0), -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][Neg]neg().2208988800); |
| 1428 | let time = ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilTime#( |
| 1429 | Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(2000), |
| 1430 | Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Februaryrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#February#, |
| 1431 | DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Lastrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Last#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#), |
| 1432 | TimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpecAndType#(TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Hoursrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Hours#(9), TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#), |
| 1433 | ); |
| 1434 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(time.to_timestamprust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[ChangeTime]to_timestamp().(3600, 3600), 951642000 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). 2 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Mul<Self>`]mul(). 3600); |
| 1435 | } |
| 1436 | |
| 1437 | macro_rules! testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test! { |
| 1438 | ($name:ident: $input:expr => $result:expr) => { |
| 1439 | #[test] |
| 1440 | fn $name() { |
| 1441 | assert_eq!(Line::new($input), $result); |
| 1442 | } |
| 1443 | }; |
| 1444 | } |
| 1445 | |
| 1446 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(emptyrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/empty().: "" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Spacerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Space#)); |
| 1447 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(spacesrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/spaces().: " " => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Spacerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Space#)); |
| 1448 | |
| 1449 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(rule_1rust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/rule_1().: "Rule US 1967 1973 ‐ Apr lastSun 2:00 1:00 D" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Rule#(Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule# { |
| 1450 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#name.: "US", |
| 1451 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1967), |
| 1452 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#to_year.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1973)), |
| 1453 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, |
| 1454 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Lastrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Last#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#), |
| 1455 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(2, 0).with_typerust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec]with_type().(TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#), |
| 1456 | time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time_to_add.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(1, 0), |
| 1457 | lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#letters.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#("D"), |
| 1458 | }))); |
| 1459 | |
| 1460 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(rule_2rust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/rule_2().: "Rule Greece 1976 only - Oct 10 2:00s 0 -" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Rule#(Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule# { |
| 1461 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#name.: "Greece", |
| 1462 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1976), |
| 1463 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#to_year.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1464 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, |
| 1465 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Ordinalrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Ordinal#(10), |
| 1466 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(2, 0).with_typerust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec]with_type().(TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Standardrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Standard#), |
| 1467 | time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time_to_add.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::Hoursrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#Hours#(0), |
| 1468 | lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#letters.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1469 | }))); |
| 1470 | |
| 1471 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(rule_3rust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/rule_3().: "Rule EU 1977 1980 - Apr Sun>=1 1:00u 1:00 S" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Rule#(Rulerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule# { |
| 1472 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#name.: "EU", |
| 1473 | from_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#from_year.: Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1977), |
| 1474 | to_yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#to_year.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1980)), |
| 1475 | monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#month.: Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Aprilrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#April#, |
| 1476 | dayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#day.: DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::FirstOnOrAfterrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#FirstOnOrAfter#(Weekdayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#::Sundayrust-analyzer cargo parse-zoneinfo 0.5.0 line/Weekday#Sunday#, 1), |
| 1477 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(1, 0).with_typerust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec]with_type().(TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::UTCrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#UTC#), |
| 1478 | time_to_addrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#time_to_add.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(1, 0), |
| 1479 | lettersrust-analyzer cargo parse-zoneinfo 0.5.0 line/Rule#letters.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#("S"), |
| 1480 | }))); |
| 1481 | |
| 1482 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(no_hyphenrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/no_hyphen().: "Rule EU 1977 1980 HEY Apr Sun>=1 1:00u 1:00 S" => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::TypeColumnContainedNonHyphenrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#TypeColumnContainedNonHyphen#("HEY".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))); |
| 1483 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(bad_monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/bad_month().: "Rule EU 1977 1980 - Febtober Sun>=1 1:00u 1:00 S" => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::FailedMonthParserust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#FailedMonthParse#("febtober".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))); |
| 1484 | |
| 1485 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/zone().: "Zone Australia/Adelaide 9:30 Aus AC%sT 1971 Oct 31 2:00:00" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Zone#(Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone# { |
| 1486 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#name.: "Australia/Adelaide", |
| 1487 | inforust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#info.: ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo# { |
| 1488 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(9, 30), |
| 1489 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#::Multiplerust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#Multiple#("Aus"), |
| 1490 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format.: "AC%sT", |
| 1491 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilTime#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1971), Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Ordinalrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Ordinal#(31), TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(2, 0, 0).with_typerust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec]with_type().(TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#))), |
| 1492 | }, |
| 1493 | }))); |
| 1494 | |
| 1495 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(continuation_1rust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/continuation_1().: " 9:30 Aus AC%sT 1971 Oct 31 2:00:00" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Continuationrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Continuation#(ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo# { |
| 1496 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(9, 30), |
| 1497 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#::Multiplerust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#Multiple#("Aus"), |
| 1498 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format.: "AC%sT", |
| 1499 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilTime#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1971), Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Ordinalrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Ordinal#(31), TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(2, 0, 0).with_typerust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[TimeSpec]with_type().(TimeTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#::Wallrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeType#Wall#))), |
| 1500 | }))); |
| 1501 | |
| 1502 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(continuation_2rust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/continuation_2().: " 1:00 C-Eur CE%sT 1943 Oct 25" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Continuationrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Continuation#(ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo# { |
| 1503 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutes#(1, 00), |
| 1504 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#::Multiplerust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#Multiple#("C-Eur"), |
| 1505 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format.: "CE%sT", |
| 1506 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilDayrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilDay#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1943), Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Octoberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#October#, DaySpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#::Ordinalrust-analyzer cargo parse-zoneinfo 0.5.0 line/DaySpec#Ordinal#(25))), |
| 1507 | }))); |
| 1508 | |
| 1509 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(zone_hyphenrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/zone_hyphen().: "Zone Asia/Ust-Nera\t 9:32:54 -\tLMT\t1919" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Zone#(Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone# { |
| 1510 | namerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#name.: "Asia/Ust-Nera", |
| 1511 | inforust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#info.: ZoneInforust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo# { |
| 1512 | utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset.: TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(9, 32, 54), |
| 1513 | savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#saving.: Savingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#::NoSavingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Saving#NoSaving#, |
| 1514 | formatrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#format.: "LMT", |
| 1515 | timerust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#time.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ChangeTimerust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#::UntilYearrust-analyzer cargo parse-zoneinfo 0.5.0 line/ChangeTime#UntilYear#(Yearrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#::Numberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Year#Number#(1919))), |
| 1516 | }, |
| 1517 | }))); |
| 1518 | |
| 1519 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1520 | fn negative_offsetsrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/negative_offsets().() { |
| 1521 | static LINErust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/LINE.: &str = "Zone Europe/London -0:01:15 - LMT 1847 Dec 1 0:00s"; |
| 1522 | let zone = Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Zone<'a>`]from_str().(LINErust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/LINE.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 1523 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1524 | zone.inforust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#info..utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset., |
| 1525 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().1, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().15) |
| 1526 | ); |
| 1527 | } |
| 1528 | |
| 1529 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1530 | fn negative_offsets_2rust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/negative_offsets_2().() { |
| 1531 | static LINErust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/LINE.: &str = |
| 1532 | "Zone Europe/Madrid -0:14:44 - LMT 1901 Jan 1 0:00s"; |
| 1533 | let zone = Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Zone<'a>`]from_str().(LINErust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/LINE.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 1534 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1535 | zone.inforust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#info..utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset., |
| 1536 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().14, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().44) |
| 1537 | ); |
| 1538 | } |
| 1539 | |
| 1540 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1541 | fn negative_offsets_3rust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/negative_offsets_3().() { |
| 1542 | static LINErust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/LINE.: &str = "Zone America/Danmarkshavn -1:14:40 - LMT 1916 Jul 28"; |
| 1543 | let zone = Zonerust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[`Zone<'a>`]from_str().(LINErust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/LINE.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 1544 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 1545 | zone.inforust-analyzer cargo parse-zoneinfo 0.5.0 line/Zone#info..utc_offsetrust-analyzer cargo parse-zoneinfo 0.5.0 line/ZoneInfo#utc_offset., |
| 1546 | TimeSpecrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#::HoursMinutesSecondsrust-analyzer cargo parse-zoneinfo 0.5.0 line/TimeSpec#HoursMinutesSeconds#(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().1, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().14, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().40) |
| 1547 | ); |
| 1548 | } |
| 1549 | |
| 1550 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/link().: "Link Europe/Istanbul Asia/Istanbul" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Link#(Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link# { |
| 1551 | existingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#existing.: "Europe/Istanbul", |
| 1552 | newrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#new.: "Asia/Istanbul", |
| 1553 | }))); |
| 1554 | |
| 1555 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1556 | fn monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/month().() { |
| 1557 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month][FromStr]from_str().("Aug"), Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Augustrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#August#)); |
| 1558 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::from_strrust-analyzer cargo parse-zoneinfo 0.5.0 line/impl#[Month][FromStr]from_str().("December"), Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Monthrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#::Decemberrust-analyzer cargo parse-zoneinfo 0.5.0 line/Month#December#)); |
| 1559 | } |
| 1560 | |
| 1561 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(golbrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/golb().: "GOLB" => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidLineTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidLineType#("GOLB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))); |
| 1562 | |
| 1563 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(commentrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/comment().: "# this is a comment" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Spacerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Space#)); |
| 1564 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(another_commentrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/another_comment().: " # so is this" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Spacerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Space#)); |
| 1565 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(multiple_hashrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/multiple_hash().: " # so is this ## " => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Spacerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Space#)); |
| 1566 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(non_commentrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/non_comment().: " this is not a # comment" => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#::InvalidTimeSpecAndTyperust-analyzer cargo parse-zoneinfo 0.5.0 line/Error#InvalidTimeSpecAndType#("this".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))); |
| 1567 | |
| 1568 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(comment_afterrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/comment_after().: "Link Europe/Istanbul Asia/Istanbul #with a comment after" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Link#(Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link# { |
| 1569 | existingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#existing.: "Europe/Istanbul", |
| 1570 | newrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#new.: "Asia/Istanbul", |
| 1571 | }))); |
| 1572 | |
| 1573 | testrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/test!!(two_comments_afterrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/two_comments_after().: "Link Europe/Istanbul Asia/Istanbul # comment ## comment" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Linerust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#::Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Line#Link#(Linkrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link# { |
| 1574 | existingrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#existing.: "Europe/Istanbul", |
| 1575 | newrust-analyzer cargo parse-zoneinfo 0.5.0 line/Link#new.: "Asia/Istanbul", |
| 1576 | }))); |
| 1577 | |
| 1578 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 1579 | fn leap_yearsrust-analyzer cargo parse-zoneinfo 0.5.0 line/tests/leap_years().() { |
| 1580 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(1900)); |
| 1581 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(1904)); |
| 1582 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(1964)); |
| 1583 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(1996)); |
| 1584 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(1997)); |
| 1585 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(1997)); |
| 1586 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(1999)); |
| 1587 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(2000)); |
| 1588 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(2016)); |
| 1589 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_leaprust-analyzer cargo parse-zoneinfo 0.5.0 line/is_leap().(2100)); |
| 1590 | } |
| 1591 | } |