From e9e7bdd99c515421083f4e5b6913d62e69f53c28 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Tue, 7 Feb 2017 04:51:08 +0900 Subject: [PATCH] Removed older aliases (previously marked as deprecated). The intention was to add newer methods using `std::time::Duration` to the older names, but it will break the API compatibility anyway. Better to completely remove them right now. --- src/date.rs | 29 ----------------------------- src/naive/datetime.rs | 30 ------------------------------ src/naive/time.rs | 30 ------------------------------ 3 files changed, 89 deletions(-) diff --git a/src/date.rs b/src/date.rs index aa63706..a88ac18 100644 --- a/src/date.rs +++ b/src/date.rs @@ -231,24 +231,6 @@ impl Date { self.date.signed_duration_since(rhs.date) } - /// Same to [`Date::checked_add_signed`](#method.checked_add_signed). - #[inline] - #[deprecated(since = "0.2.26", - note = "Renamed to `checked_add_signed`, \ - will be replaced with a version with `std::time::Duration`")] - pub fn checked_add(self, rhs: OldDuration) -> Option> { - self.checked_add_signed(rhs) - } - - /// Same to [`Date::checked_sub_signed`](#method.checked_sub_signed). - #[inline] - #[deprecated(since = "0.2.26", - note = "Renamed to `checked_sub_signed`, \ - will be replaced with a version with `std::time::Duration`")] - pub fn checked_sub(self, rhs: OldDuration) -> Option> { - self.checked_sub_signed(rhs) - } - /// Returns a view to the naive UTC date. #[inline] pub fn naive_utc(&self) -> NaiveDate { @@ -370,17 +352,6 @@ impl Add for Date { } } -// XXX this does not really work yet -#[deprecated(since = "0.2.26", note = "Use `signed_duration_since` method instead")] -impl Sub> for Date { - type Output = OldDuration; - - #[inline] - fn sub(self, rhs: Date) -> OldDuration { - self.signed_duration_since(rhs) - } -} - impl Sub for Date { type Output = Date; diff --git a/src/naive/datetime.rs b/src/naive/datetime.rs index 249659e..81ac8af 100644 --- a/src/naive/datetime.rs +++ b/src/naive/datetime.rs @@ -543,24 +543,6 @@ impl NaiveDateTime { self.date.signed_duration_since(rhs.date) + self.time.signed_duration_since(rhs.time) } - /// Same to [`NaiveDateTime::checked_add_signed`](#method.checked_add_signed). - #[inline] - #[deprecated(since = "0.2.26", - note = "Renamed to `checked_add_signed`, \ - will be replaced with a version with `std::time::Duration`")] - pub fn checked_add(self, rhs: OldDuration) -> Option { - self.checked_add_signed(rhs) - } - - /// Same to [`NaiveDateTime::checked_sub_signed`](#method.checked_sub_signed). - #[inline] - #[deprecated(since = "0.2.26", - note = "Renamed to `checked_sub_signed`, \ - will be replaced with a version with `std::time::Duration`")] - pub fn checked_sub(self, rhs: OldDuration) -> Option { - self.checked_sub_signed(rhs) - } - /// Formats the combined date and time with the specified formatting items. /// Otherwise it is same to the ordinary [`format`](#method.format) method. /// @@ -1193,18 +1175,6 @@ impl Add for NaiveDateTime { } } -/// Use [`NaiveDateTime::signed_duration_since`](#method.signed_duration_since) instead. -// XXX this does not really work yet -#[deprecated(since = "0.2.26", note = "Use `signed_duration_since` method instead")] -impl Sub for NaiveDateTime { - type Output = OldDuration; - - #[inline] - fn sub(self, rhs: NaiveDateTime) -> OldDuration { - self.signed_duration_since(rhs) - } -} - /// A subtraction of `Duration` from `NaiveDateTime` yields another `NaiveDateTime`. /// It is same to the addition with a negated `Duration`. /// diff --git a/src/naive/time.rs b/src/naive/time.rs index 5171358..2d9c7bc 100644 --- a/src/naive/time.rs +++ b/src/naive/time.rs @@ -695,24 +695,6 @@ impl NaiveTime { OldDuration::seconds(secs + adjust) + OldDuration::nanoseconds(frac) } - /// Same to [`NaiveTime::overflowing_add_signed`](#method.overflowing_add_signed). - #[inline] - #[deprecated(since = "0.2.26", - note = "Renamed to `overflowing_add_signed`, \ - will be replaced with a version with `std::time::Duration`")] - pub fn overflowing_add(self, rhs: OldDuration) -> (NaiveTime, i64) { - self.overflowing_add_signed(rhs) - } - - /// Same to [`NaiveTime::overflowing_sub_signed`](#method.overflowing_sub_signed). - #[inline] - #[deprecated(since = "0.2.26", - note = "Renamed to `overflowing_sub_signed`, \ - will be replaced with a version with `std::time::Duration`")] - pub fn overflowing_sub(self, rhs: OldDuration) -> (NaiveTime, i64) { - self.overflowing_sub_signed(rhs) - } - /// Formats the time with the specified formatting items. /// Otherwise it is same to the ordinary [`format`](#method.format) method. /// @@ -1072,18 +1054,6 @@ impl Add for NaiveTime { } } -/// Use [`NaiveTime::signed_duration_since`](#method.signed_duration_since) instead. -// XXX this does not really work yet -#[deprecated(since = "0.2.26", note = "Use `signed_duration_since` method instead")] -impl Sub for NaiveTime { - type Output = OldDuration; - - #[inline] - fn sub(self, rhs: NaiveTime) -> OldDuration { - self.signed_duration_since(rhs) - } -} - /// A subtraction of `Duration` from `NaiveTime` wraps around and never overflows or underflows. /// In particular the addition ignores integral number of days. /// It is same to the addition with a negated `Duration`.