Move `SubAssign<OldDuration> next to `Sub<OldDuration`

This commit is contained in:
Toby Dimmick 2018-04-03 14:16:37 +01:00
parent d9a50cb767
commit 19466e6ff4
3 changed files with 21 additions and 21 deletions

View File

@ -1378,6 +1378,13 @@ impl Sub<OldDuration> for NaiveDate {
}
}
impl SubAssign<OldDuration> for NaiveDate {
#[inline]
fn sub_assign(&mut self, rhs: OldDuration) {
*self = self.sub(rhs);
}
}
/// Subtracts another `NaiveDate` from the current date.
/// Returns a `Duration` of integral numbers.
///
@ -1414,13 +1421,6 @@ impl Sub<NaiveDate> for NaiveDate {
}
}
impl SubAssign<OldDuration> for NaiveDate {
#[inline]
fn sub_assign(&mut self, rhs: OldDuration) {
*self = self.sub(rhs);
}
}
/// The `Debug` output of the naive date `d` is same to
/// [`d.format("%Y-%m-%d")`](../format/strftime/index.html).
///

View File

@ -1272,6 +1272,13 @@ impl Sub<OldDuration> for NaiveDateTime {
}
}
impl SubAssign<OldDuration> for NaiveDateTime {
#[inline]
fn sub_assign(&mut self, rhs: OldDuration) {
*self = self.sub(rhs);
}
}
/// Subtracts another `NaiveDateTime` from the current date and time.
/// This does not overflow or underflow at all.
///
@ -1327,13 +1334,6 @@ impl Sub<NaiveDateTime> for NaiveDateTime {
}
}
impl SubAssign<OldDuration> for NaiveDateTime {
#[inline]
fn sub_assign(&mut self, rhs: OldDuration) {
*self = self.sub(rhs);
}
}
/// The `Debug` output of the naive date and time `dt` is same to
/// [`dt.format("%Y-%m-%dT%H:%M:%S%.f")`](../format/strftime/index.html).
///

View File

@ -1126,6 +1126,13 @@ impl Sub<OldDuration> for NaiveTime {
}
}
impl SubAssign<OldDuration> for NaiveTime {
#[inline]
fn sub_assign(&mut self, rhs: OldDuration) {
*self = self.sub(rhs);
}
}
/// Subtracts another `NaiveTime` from the current time.
/// Returns a `Duration` within +/- 1 day.
/// This does not overflow or underflow at all.
@ -1186,13 +1193,6 @@ impl Sub<NaiveTime> for NaiveTime {
}
}
impl SubAssign<OldDuration> for NaiveTime {
#[inline]
fn sub_assign(&mut self, rhs: OldDuration) {
*self = self.sub(rhs);
}
}
/// The `Debug` output of the naive time `t` is same to
/// [`t.format("%H:%M:%S%.f")`](../format/strftime/index.html).
///