diff options
Diffstat (limited to 'vendor/time/src/lib.rs')
-rw-r--r-- | vendor/time/src/lib.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/vendor/time/src/lib.rs b/vendor/time/src/lib.rs index ed4042e03..2ab59cf8e 100644 --- a/vendor/time/src/lib.rs +++ b/vendor/time/src/lib.rs @@ -204,13 +204,15 @@ macro_rules! cascade { (@year year) => {}; // Cascade an out-of-bounds value from "from" to "to". - ($from:ident in $min:literal.. $max:literal => $to:tt) => { + ($from:ident in $min:literal.. $max:expr => $to:tt) => { #[allow(unused_comparisons, unused_assignments)] - if $from >= $max { - $from -= $max - $min; + let min = $min; + let max = $max; + if $from >= max { + $from -= max - min; $to += 1; - } else if $from < $min { - $from += $max - $min; + } else if $from < min { + $from += max - min; $to -= 1; } }; @@ -310,9 +312,6 @@ macro_rules! bug { } // endregion macros -#[macro_use] -mod shim; - mod date; mod date_time; mod duration; @@ -346,6 +345,9 @@ mod utc_offset; pub mod util; mod weekday; +// Not public yet. +use time_core::convert; + pub use crate::date::Date; use crate::date_time::DateTime; pub use crate::duration::Duration; |