From 51aa03e33dcd9c86ce66ad73036c5cc39edd4439 Mon Sep 17 00:00:00 2001 From: Yureka Date: Sat, 9 Apr 2022 10:21:15 +0200 Subject: [PATCH] some lint errors from the 1.60 upgrade --- src/offset/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/offset/mod.rs b/src/offset/mod.rs index cc04bc568e..237b5505f1 100644 --- a/src/offset/mod.rs +++ b/src/offset/mod.rs @@ -430,6 +430,7 @@ pub trait TimeZone: Sized + Clone { fn offset_from_local_datetime(&self, local: &NaiveDateTime) -> LocalResult; /// Converts the local `NaiveDate` to the timezone-aware `Date` if possible. + #[allow(clippy::wrong_self_convention)] fn from_local_date(&self, local: &NaiveDate) -> LocalResult> { self.offset_from_local_date(local).map(|offset| { // since FixedOffset is within +/- 1 day, the date is never affected @@ -438,6 +439,7 @@ pub trait TimeZone: Sized + Clone { } /// Converts the local `NaiveDateTime` to the timezone-aware `DateTime` if possible. + #[allow(clippy::wrong_self_convention)] fn from_local_datetime(&self, local: &NaiveDateTime) -> LocalResult> { self.offset_from_local_datetime(local) .map(|offset| DateTime::from_utc(*local - offset.fix(), offset)) @@ -451,12 +453,14 @@ pub trait TimeZone: Sized + Clone { /// Converts the UTC `NaiveDate` to the local time. /// The UTC is continuous and thus this cannot fail (but can give the duplicate local time). + #[allow(clippy::wrong_self_convention)] fn from_utc_date(&self, utc: &NaiveDate) -> Date { Date::from_utc(*utc, self.offset_from_utc_date(utc)) } /// Converts the UTC `NaiveDateTime` to the local time. /// The UTC is continuous and thus this cannot fail (but can give the duplicate local time). + #[allow(clippy::wrong_self_convention)] fn from_utc_datetime(&self, utc: &NaiveDateTime) -> DateTime { DateTime::from_utc(*utc, self.offset_from_utc_datetime(utc)) }