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.
This commit is contained in:
Kang Seonghoon 2015-01-08 02:06:30 +09:00
parent e97993d76a
commit d79c460fc4
9 changed files with 6 additions and 50 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "chrono"
version = "0.1.11"
version = "0.1.12"
authors = ["Kang Seonghoon <public+rust@mearie.org>"]
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"

View File

@ -1,4 +1,4 @@
[Chrono][doc] 0.1.11
[Chrono][doc] 0.1.12
====================
[![Chrono on Travis CI][travis-image]][travis]

View File

@ -271,13 +271,6 @@ impl<Off:Offset> Add<Duration> for Date<Off> {
}
}
impl<Off:Offset> Add<Date<Off>> for Duration {
type Output = Date<Off>;
#[inline]
fn add(self, rhs: Date<Off>) -> Date<Off> { rhs.add(self) }
}
impl<Off:Offset, Off2:Offset> Sub<Date<Off2>> for Date<Off> {
type Output = Duration;

View File

@ -192,13 +192,6 @@ impl<Off:Offset> Add<Duration> for DateTime<Off> {
}
}
impl<Off:Offset> Add<DateTime<Off>> for Duration {
type Output = DateTime<Off>;
#[inline]
fn add(self, rhs: DateTime<Off>) -> DateTime<Off> { rhs.add(self) }
}
impl<Off:Offset, Off2:Offset> Sub<DateTime<Off2>> for DateTime<Off> {
type Output = Duration;

View File

@ -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;

View File

@ -398,13 +398,6 @@ impl Add<Duration> for NaiveDate {
}
}
impl Add<NaiveDate> for Duration {
type Output = NaiveDate;
#[inline]
fn add(self, rhs: NaiveDate) -> NaiveDate { rhs.add(self) }
}
impl Sub<NaiveDate> 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));

View File

@ -186,13 +186,6 @@ impl Add<Duration> for NaiveDateTime {
}
}
impl Add<NaiveDateTime> for Duration {
type Output = NaiveDateTime;
#[inline]
fn add(self, rhs: NaiveDateTime) -> NaiveDateTime { rhs.add(self) }
}
impl Sub<NaiveDateTime> for NaiveDateTime {
type Output = Duration;

View File

@ -193,13 +193,6 @@ impl Add<Duration> for NaiveTime {
}
}
impl Add<NaiveTime> for Duration {
type Output = NaiveTime;
#[inline]
fn add(self, rhs: NaiveTime) -> NaiveTime { rhs.add(self) }
}
impl Sub<NaiveTime> 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);

View File

@ -120,13 +120,6 @@ impl<Off:Offset> Add<Duration> for Time<Off> {
}
}
impl<Off:Offset> Add<Time<Off>> for Duration {
type Output = Time<Off>;
#[inline]
fn add(self, rhs: Time<Off>) -> Time<Off> { rhs.add(self) }
}
impl<Off:Offset, Off2:Offset> Sub<Time<Off2>> for Time<Off> {
type Output = Duration;