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.
This commit is contained in:
parent
96b5ba391b
commit
e9e7bdd99c
29
src/date.rs
29
src/date.rs
|
@ -231,24 +231,6 @@ impl<Tz: TimeZone> Date<Tz> {
|
|||
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<Date<Tz>> {
|
||||
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<Date<Tz>> {
|
||||
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<Tz: TimeZone> Add<OldDuration> for Date<Tz> {
|
|||
}
|
||||
}
|
||||
|
||||
// XXX this does not really work yet
|
||||
#[deprecated(since = "0.2.26", note = "Use `signed_duration_since` method instead")]
|
||||
impl<Tz: TimeZone, Tz2: TimeZone> Sub<Date<Tz2>> for Date<Tz> {
|
||||
type Output = OldDuration;
|
||||
|
||||
#[inline]
|
||||
fn sub(self, rhs: Date<Tz2>) -> OldDuration {
|
||||
self.signed_duration_since(rhs)
|
||||
}
|
||||
}
|
||||
|
||||
impl<Tz: TimeZone> Sub<OldDuration> for Date<Tz> {
|
||||
type Output = Date<Tz>;
|
||||
|
||||
|
|
|
@ -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<NaiveDateTime> {
|
||||
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<NaiveDateTime> {
|
||||
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<OldDuration> 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<NaiveDateTime> 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`.
|
||||
///
|
||||
|
|
|
@ -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<OldDuration> 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<NaiveTime> 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`.
|
||||
|
|
Loading…
Reference in New Issue