From 0e6d1d49b70d7b41f445044d2d3aeebdf3d614d6 Mon Sep 17 00:00:00 2001 From: David Kellum Date: Fri, 12 Jan 2018 16:08:34 -0800 Subject: [PATCH] cleanup name resolution for backward compatibility so it builds with rustc 1.13 --- src/datetime.rs | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/datetime.rs b/src/datetime.rs index a03b42b..41f30b3 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -281,38 +281,37 @@ impl DateTime where Tz::Offset: fmt::Display { fn rfc3339_via_items(&self, subform: Option, use_z: bool) -> String { - use format::Item::*; use format::Numeric::*; use format::Pad::Zero; - use format::Fixed::*; - use format::Fixed::Nanosecond; const PREFIX: &'static [Item<'static>] = &[ - Numeric(Year, Zero), - Literal("-"), - Numeric(Month, Zero), - Literal("-"), - Numeric(Day, Zero), - Literal("T"), - Numeric(Hour, Zero), - Literal(":"), - Numeric(Minute, Zero), - Literal(":"), - Numeric(Second, Zero), + Item::Numeric(Year, Zero), + Item::Literal("-"), + Item::Numeric(Month, Zero), + Item::Literal("-"), + Item::Numeric(Day, Zero), + Item::Literal("T"), + Item::Numeric(Hour, Zero), + Item::Literal(":"), + Item::Numeric(Minute, Zero), + Item::Literal(":"), + Item::Numeric(Second, Zero), ]; let ssitem = match subform { None => None, Some(sf) => match sf { - Nanosecond | - Nanosecond3 | Nanosecond6 | Nanosecond9 => Some(Fixed(sf)), + Fixed::Nanosecond | + Fixed::Nanosecond3 | + Fixed::Nanosecond6 | + Fixed::Nanosecond9 => Some(Item::Fixed(sf)), _ => panic!("Unsupported rfc_3339p subsecond format {:?}", sf) } }; - let tzitem = Fixed(match use_z { - true => TimezoneOffsetColonZ, - false => TimezoneOffsetColon + let tzitem = Item::Fixed(match use_z { + true => Fixed::TimezoneOffsetColonZ, + false => Fixed::TimezoneOffsetColon }); match ssitem {