Allow (clippy) needless_pass_by_value on signed_duration_since

Current clippy is probably correct, but its a breaking change that
isn't appropriate now. Add allow's to get the build working again.

Also these Date(Time)::signed_duration_since cases appear to match
there `Naive` counterparts, where clippy isn't complaining. If its
fixed in the future, should probably be changed across the board, not
just here.
This commit is contained in:
David Kellum 2018-01-17 11:41:33 -08:00
parent 4748225550
commit 9742ecccc5
2 changed files with 2 additions and 0 deletions

View File

@ -224,6 +224,7 @@ impl<Tz: TimeZone> Date<Tz> {
/// ///
/// This does not overflow or underflow at all, /// This does not overflow or underflow at all,
/// as all possible output fits in the range of `Duration`. /// as all possible output fits in the range of `Duration`.
#[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
#[inline] #[inline]
pub fn signed_duration_since<Tz2: TimeZone>(self, rhs: Date<Tz2>) -> OldDuration { pub fn signed_duration_since<Tz2: TimeZone>(self, rhs: Date<Tz2>) -> OldDuration {
self.date.signed_duration_since(rhs.date) self.date.signed_duration_since(rhs.date)

View File

@ -159,6 +159,7 @@ impl<Tz: TimeZone> DateTime<Tz> {
/// Subtracts another `DateTime` from the current date and time. /// Subtracts another `DateTime` from the current date and time.
/// This does not overflow or underflow at all. /// This does not overflow or underflow at all.
#[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
#[inline] #[inline]
pub fn signed_duration_since<Tz2: TimeZone>(self, rhs: DateTime<Tz2>) -> OldDuration { pub fn signed_duration_since<Tz2: TimeZone>(self, rhs: DateTime<Tz2>) -> OldDuration {
self.datetime.signed_duration_since(rhs.datetime) self.datetime.signed_duration_since(rhs.datetime)