From d79c460fc4c4d197a7854315a74ead99c1b83651 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Thu, 8 Jan 2015 02:06:30 +0900 Subject: [PATCH] 0.1.12: language changes, removed ops for Duration in the lhs. - Feature flags used are all accepted. - Orphan check workaround is no longer required. - Impl reachability rules prevent the addition of `Duration + others`, as `Duration` is not implemented in this crate. Removed the impl; use `others + Duration` as a workaround. --- Cargo.toml | 4 ++-- README.md | 2 +- src/date.rs | 7 ------- src/datetime.rs | 7 ------- src/lib.rs | 4 +--- src/naive/date.rs | 9 +-------- src/naive/datetime.rs | 7 ------- src/naive/time.rs | 9 +-------- src/time.rs | 7 ------- 9 files changed, 6 insertions(+), 50 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 56992ca..72b93ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chrono" -version = "0.1.11" +version = "0.1.12" 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.10" +time = "0.1.11" diff --git a/README.md b/README.md index 3336920..4f448a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[Chrono][doc] 0.1.11 +[Chrono][doc] 0.1.12 ==================== [![Chrono on Travis CI][travis-image]][travis] diff --git a/src/date.rs b/src/date.rs index 1ba1549..d409f0e 100644 --- a/src/date.rs +++ b/src/date.rs @@ -271,13 +271,6 @@ impl Add for Date { } } -impl Add> for Duration { - type Output = Date; - - #[inline] - fn add(self, rhs: Date) -> Date { rhs.add(self) } -} - impl Sub> for Date { type Output = Duration; diff --git a/src/datetime.rs b/src/datetime.rs index 26951a6..39fe12e 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -192,13 +192,6 @@ impl Add for DateTime { } } -impl Add> for Duration { - type Output = DateTime; - - #[inline] - fn add(self, rhs: DateTime) -> DateTime { rhs.add(self) } -} - impl Sub> for DateTime { type Output = Duration; diff --git a/src/lib.rs b/src/lib.rs index 86fd5de..845a9d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ /*! -# Chrono 0.1.11 +# Chrono 0.1.12 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. @@ -184,8 +184,6 @@ Advanced offset handling and date/time parsing is not yet supported (but is plan #![doc(html_root_url = "https://lifthrasiir.github.io/rust-chrono/")] -#![feature(macro_rules, associated_types, default_type_params)] -#![feature(old_orphan_check)] // TODO: Remove this when derive(Hash) no longer needs it. #![deny(missing_docs)] extern crate "time" as stdtime; diff --git a/src/naive/date.rs b/src/naive/date.rs index e137c7e..2ba71ab 100644 --- a/src/naive/date.rs +++ b/src/naive/date.rs @@ -398,13 +398,6 @@ impl Add for NaiveDate { } } -impl Add for Duration { - type Output = NaiveDate; - - #[inline] - fn add(self, rhs: NaiveDate) -> NaiveDate { rhs.add(self) } -} - impl Sub for NaiveDate { type Output = Duration; @@ -709,7 +702,7 @@ mod tests { let lhs = NaiveDate::from_ymd(y1, m1, d1); let sum = NaiveDate::from_ymd(y, m, d); assert_eq!(lhs + rhs, sum); - assert_eq!(rhs + lhs, sum); + //assert_eq!(rhs + lhs, sum); } check((2014, 1, 1), Duration::zero(), (2014, 1, 1)); diff --git a/src/naive/datetime.rs b/src/naive/datetime.rs index 8d57c58..f9e5e4f 100644 --- a/src/naive/datetime.rs +++ b/src/naive/datetime.rs @@ -186,13 +186,6 @@ impl Add for NaiveDateTime { } } -impl Add for Duration { - type Output = NaiveDateTime; - - #[inline] - fn add(self, rhs: NaiveDateTime) -> NaiveDateTime { rhs.add(self) } -} - impl Sub for NaiveDateTime { type Output = Duration; diff --git a/src/naive/time.rs b/src/naive/time.rs index 0085ebb..70e1c90 100644 --- a/src/naive/time.rs +++ b/src/naive/time.rs @@ -193,13 +193,6 @@ impl Add for NaiveTime { } } -impl Add for Duration { - type Output = NaiveTime; - - #[inline] - fn add(self, rhs: NaiveTime) -> NaiveTime { rhs.add(self) } -} - impl Sub for NaiveTime { type Output = Duration; @@ -314,7 +307,7 @@ mod tests { fn test_time_add() { fn check(lhs: NaiveTime, rhs: Duration, sum: NaiveTime) { assert_eq!(lhs + rhs, sum); - assert_eq!(rhs + lhs, sum); + //assert_eq!(rhs + lhs, sum); } let hmsm = |&: h,m,s,mi| NaiveTime::from_hms_milli(h, m, s, mi); diff --git a/src/time.rs b/src/time.rs index 1f685d7..cc6404f 100644 --- a/src/time.rs +++ b/src/time.rs @@ -120,13 +120,6 @@ impl Add for Time { } } -impl Add> for Duration { - type Output = Time; - - #[inline] - fn add(self, rhs: Time) -> Time { rhs.add(self) } -} - impl Sub> for Time { type Output = Duration;