diff --git a/Cargo.toml b/Cargo.toml index a764b39..9fa6ad7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chrono" -version = "0.1.14" +version = "0.1.15" authors = ["Kang Seonghoon "] description = "Date and time library for Rust" @@ -15,5 +15,5 @@ license = "MIT/Apache-2.0" name = "chrono" [dependencies] -time = "0.1.12" +time = "0.1.14" diff --git a/README.md b/README.md index b5408d7..23be8dc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[Chrono][doc] 0.1.13 +[Chrono][doc] 0.1.15 ==================== [![Chrono on Travis CI][travis-image]][travis] diff --git a/src/date.rs b/src/date.rs index 5b0c556..7580899 100644 --- a/src/date.rs +++ b/src/date.rs @@ -181,7 +181,7 @@ impl Date { } } -impl Date { +impl Date { /// Formats the date in the specified format string. /// See the `format` module on the supported escape sequences. #[inline] @@ -286,13 +286,13 @@ impl Sub for Date { fn sub(self, rhs: Duration) -> Date { self.add(-rhs) } } -impl fmt::Show for Date { +impl fmt::Debug for Date { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}{:?}", self.local(), self.offset) } } -impl fmt::String for Date { +impl fmt::Display for Date { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}{}", self.local(), self.offset) } @@ -334,7 +334,7 @@ mod tests { } } - impl fmt::Show for UTC1y { + impl fmt::Debug for UTC1y { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "+8760:00") } } diff --git a/src/datetime.rs b/src/datetime.rs index 9b40883..25b00a6 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -70,7 +70,7 @@ impl DateTime { } } -impl DateTime { +impl DateTime { /// Formats the combined date and time in the specified format string. /// See the `format` module on the supported escape sequences. #[inline] @@ -207,13 +207,13 @@ impl Sub for DateTime { fn sub(self, rhs: Duration) -> DateTime { self.add(-rhs) } } -impl fmt::Show for DateTime { +impl fmt::Debug for DateTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}{:?}", self.local(), self.offset) } } -impl fmt::String for DateTime { +impl fmt::Display for DateTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} {}", self.local(), self.offset) } diff --git a/src/format.rs b/src/format.rs index af7dc61..bba6d2e 100644 --- a/src/format.rs +++ b/src/format.rs @@ -201,13 +201,13 @@ impl<'a> DelayedFormat<'a> { /// Makes a new `DelayedFormat` value out of local date and time and UTC offset. pub fn new_with_offset(date: Option, time: Option, offset: &Off, fmt: &'a str) -> DelayedFormat<'a> - where Off: Offset + fmt::String { + where Off: Offset + fmt::Display { let name_and_diff = (offset.to_string(), offset.local_minus_utc()); DelayedFormat { date: date, time: time, off: Some(name_and_diff), fmt: fmt } } } -impl<'a> fmt::String for DelayedFormat<'a> { +impl<'a> fmt::Display for DelayedFormat<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let ret = format(f, self.date.as_ref(), self.time.as_ref(), self.off.as_ref(), self.fmt); ret.map_err(|_| fmt::Error) // we don't have any good means to pass detailed errors... diff --git a/src/lib.rs b/src/lib.rs index 9b9a983..af9dfcb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ /*! -# Chrono 0.1.14 +# Chrono 0.1.15 Date and time handling for Rust. (also known as `rust-chrono`) It aims to be a feature-complete superset of the [time](https://github.com/rust-lang/time) library. diff --git a/src/naive/date.rs b/src/naive/date.rs index bd3e137..71c07f2 100644 --- a/src/naive/date.rs +++ b/src/naive/date.rs @@ -425,7 +425,7 @@ impl Sub for NaiveDate { fn sub(self, rhs: Duration) -> NaiveDate { self.add(-rhs) } } -impl fmt::Show for NaiveDate { +impl fmt::Debug for NaiveDate { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let year = self.year(); let mdf = self.mdf(); @@ -438,7 +438,7 @@ impl fmt::Show for NaiveDate { } } -impl fmt::String for NaiveDate { +impl fmt::Display for NaiveDate { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let year = self.year(); let mdf = self.mdf(); @@ -930,7 +930,7 @@ mod internals { } } - impl fmt::Show for YearFlags { + impl fmt::Debug for YearFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let YearFlags(flags) = *self; match flags { @@ -1152,7 +1152,7 @@ mod internals { } } - impl fmt::Show for Of { + impl fmt::Debug for Of { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let Of(of) = *self; write!(f, "Of(({} << 4) | {:#04o} /*{:?}*/)", @@ -1249,7 +1249,7 @@ mod internals { } } - impl fmt::Show for Mdf { + impl fmt::Debug for Mdf { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let Mdf(mdf) = *self; write!(f, "Mdf(({} << 9) | ({} << 4) | {:#04o} /*{:?}*/)", diff --git a/src/naive/datetime.rs b/src/naive/datetime.rs index f531845..9fdfc9e 100644 --- a/src/naive/datetime.rs +++ b/src/naive/datetime.rs @@ -205,13 +205,13 @@ impl Sub for NaiveDateTime { fn sub(self, rhs: Duration) -> NaiveDateTime { self.add(-rhs) } } -impl fmt::Show for NaiveDateTime { +impl fmt::Debug for NaiveDateTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}T{:?}", self.date, self.time) } } -impl fmt::String for NaiveDateTime { +impl fmt::Display for NaiveDateTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} {}", self.date, self.time) } diff --git a/src/naive/time.rs b/src/naive/time.rs index 0a50e46..a235edb 100644 --- a/src/naive/time.rs +++ b/src/naive/time.rs @@ -223,7 +223,7 @@ impl Sub for NaiveTime { fn sub(self, rhs: Duration) -> NaiveTime { self.add(-rhs) } } -impl fmt::Show for NaiveTime { +impl fmt::Debug for NaiveTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let (hour, min, sec) = self.hms(); let (sec, nano) = if self.frac >= 1_000_000_000 { @@ -245,8 +245,8 @@ impl fmt::Show for NaiveTime { } } -impl fmt::String for NaiveTime { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Show::fmt(self, f) } +impl fmt::Display for NaiveTime { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(self, f) } } #[cfg(test)] diff --git a/src/offset.rs b/src/offset.rs index 61bcb8c..467f672 100644 --- a/src/offset.rs +++ b/src/offset.rs @@ -123,7 +123,7 @@ impl LocalResult> { } -impl LocalResult { +impl LocalResult { /// Returns the single unique conversion result, or fails accordingly. pub fn unwrap(self) -> T { match self { @@ -137,7 +137,7 @@ impl LocalResult { } /// The offset from the local time to UTC. -pub trait Offset: Clone + fmt::Show { +pub trait Offset: Clone + fmt::Debug { /// Makes a new `Date` from year, month, day and the current offset. /// This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. /// @@ -350,11 +350,11 @@ impl Offset for UTC { fn to_local_datetime(&self, utc: &NaiveDateTime) -> NaiveDateTime { utc.clone() } } -impl fmt::Show for UTC { +impl fmt::Debug for UTC { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Z") } } -impl fmt::String for UTC { +impl fmt::Display for UTC { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "UTC") } } @@ -434,7 +434,7 @@ impl Offset for FixedOffset { } } -impl fmt::Show for FixedOffset { +impl fmt::Debug for FixedOffset { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let offset = self.local_minus_utc; let (sign, offset) = if offset < 0 {('-', -offset)} else {('+', offset)}; @@ -448,8 +448,8 @@ impl fmt::Show for FixedOffset { } } -impl fmt::String for FixedOffset { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Show::fmt(self, f) } +impl fmt::Display for FixedOffset { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(self, f) } } /// The local timescale. This is implemented via the standard `time` crate. @@ -537,11 +537,11 @@ impl Offset for Local { } } -impl fmt::Show for Local { +impl fmt::Debug for Local { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.cached.fmt(f) } } -impl fmt::String for Local { +impl fmt::Display for Local { // TODO this should be a tz name whenever available fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.cached.fmt(f) } } diff --git a/src/time.rs b/src/time.rs index 19337c8..ded3b95 100644 --- a/src/time.rs +++ b/src/time.rs @@ -50,7 +50,7 @@ impl Time { } } -impl Time { +impl Time { /// Formats the time in the specified format string. /// See the `format` module on the supported escape sequences. #[inline] @@ -135,13 +135,13 @@ impl Sub for Time { fn sub(self, rhs: Duration) -> Time { self.add(-rhs) } } -impl fmt::Show for Time { +impl fmt::Debug for Time { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}{:?}", self.local(), self.offset) } } -impl fmt::String for Time { +impl fmt::Display for Time { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}{}", self.local(), self.offset) }