Merge pull request #206 from dekellum/clippy-allow-static-lifetime-for-now

Clippy allowances to get the build passing again
This commit is contained in:
Brandon W Maister 2018-01-18 13:25:24 -05:00 committed by GitHub
commit 232a0f1255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -224,6 +224,7 @@ impl<Tz: TimeZone> Date<Tz> {
///
/// 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<Tz2: TimeZone>(self, rhs: Date<Tz2>) -> OldDuration {
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.
/// This does not overflow or underflow at all.
#[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
#[inline]
pub fn signed_duration_since<Tz2: TimeZone>(self, rhs: DateTime<Tz2>) -> OldDuration {
self.datetime.signed_duration_since(rhs.datetime)

View File

@ -387,6 +387,12 @@
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
// The explicit 'static lifetimes are still needed for rustc 1.13-16
// backward compatibility, and this appeases clippy. If minimum rustc
// becomes 1.17, should be able to remove this, those 'static lifetimes,
// and use `static` in a lot of places `const` is used now.
#![cfg_attr(feature = "cargo-clippy", allow(const_static_lifetime))]
extern crate time as oldtime;
extern crate num;
#[cfg(feature = "rustc-serialize")]