From 9742ecccc5f2230512be1f539bf7838f2769521b Mon Sep 17 00:00:00 2001 From: David Kellum Date: Wed, 17 Jan 2018 11:41:33 -0800 Subject: [PATCH] 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. --- src/date.rs | 1 + src/datetime.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/date.rs b/src/date.rs index 7acdde7..dba7dd0 100644 --- a/src/date.rs +++ b/src/date.rs @@ -224,6 +224,7 @@ impl Date { /// /// This does not overflow or underflow at all, /// as all possible output fits in the range of `Duration`. + #[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))] #[inline] pub fn signed_duration_since(self, rhs: Date) -> OldDuration { self.date.signed_duration_since(rhs.date) diff --git a/src/datetime.rs b/src/datetime.rs index f5ca30c..6500ee7 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -159,6 +159,7 @@ impl DateTime { /// Subtracts another `DateTime` from the current date and time. /// This does not overflow or underflow at all. + #[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))] #[inline] pub fn signed_duration_since(self, rhs: DateTime) -> OldDuration { self.datetime.signed_duration_since(rhs.datetime)