From 9baf069db159eaf2c7a59b07c6e0564da93b5b7d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 29 Nov 2024 10:41:32 +0100 Subject: [PATCH 1/2] Apply suggestions from clippy 1.83 --- src/datetime/serde.rs | 12 ++++++------ src/format/mod.rs | 2 +- src/month.rs | 3 +-- src/naive/date/mod.rs | 4 ++-- src/naive/datetime/serde.rs | 12 ++++++------ src/naive/time/serde.rs | 2 +- src/weekday.rs | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/datetime/serde.rs b/src/datetime/serde.rs index 6f048a4568..e3c6bf57db 100644 --- a/src/datetime/serde.rs +++ b/src/datetime/serde.rs @@ -38,7 +38,7 @@ impl ser::Serialize for DateTime { inner: &'a DateTime, } - impl<'a, Tz: TimeZone> fmt::Display for FormatIso8601<'a, Tz> { + impl fmt::Display for FormatIso8601<'_, Tz> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let naive = self.inner.naive_local(); let offset = self.inner.offset.fix(); @@ -52,7 +52,7 @@ impl ser::Serialize for DateTime { struct DateTimeVisitor; -impl<'de> de::Visitor<'de> for DateTimeVisitor { +impl de::Visitor<'_> for DateTimeVisitor { type Value = DateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -230,7 +230,7 @@ pub mod ts_nanoseconds { d.deserialize_i64(NanoSecondsTimestampVisitor) } - impl<'de> de::Visitor<'de> for NanoSecondsTimestampVisitor { + impl de::Visitor<'_> for NanoSecondsTimestampVisitor { type Value = DateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -512,7 +512,7 @@ pub mod ts_microseconds { d.deserialize_i64(MicroSecondsTimestampVisitor) } - impl<'de> de::Visitor<'de> for MicroSecondsTimestampVisitor { + impl de::Visitor<'_> for MicroSecondsTimestampVisitor { type Value = DateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -786,7 +786,7 @@ pub mod ts_milliseconds { d.deserialize_i64(MilliSecondsTimestampVisitor).map(|dt| dt.with_timezone(&Utc)) } - impl<'de> de::Visitor<'de> for MilliSecondsTimestampVisitor { + impl de::Visitor<'_> for MilliSecondsTimestampVisitor { type Value = DateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -1052,7 +1052,7 @@ pub mod ts_seconds { d.deserialize_i64(SecondsTimestampVisitor) } - impl<'de> de::Visitor<'de> for SecondsTimestampVisitor { + impl de::Visitor<'_> for SecondsTimestampVisitor { type Value = DateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/format/mod.rs b/src/format/mod.rs index 95d86dcd8d..cd4520c217 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -366,7 +366,7 @@ const fn internal_fixed(val: InternalInternal) -> Item<'static> { Item::Fixed(Fixed::Internal(InternalFixed { val })) } -impl<'a> Item<'a> { +impl Item<'_> { /// Convert items that contain a reference to the format string into an owned variant. #[cfg(any(feature = "alloc", feature = "std"))] pub fn to_owned(self) -> Item<'static> { diff --git a/src/month.rs b/src/month.rs index f8033fccd6..f964f85d88 100644 --- a/src/month.rs +++ b/src/month.rs @@ -191,7 +191,6 @@ impl num_traits::FromPrimitive for Month { /// `Month::from_i64(n: i64)`: | `1` | `2` | ... | `12` /// ---------------------------| -------------------- | --------------------- | ... | ----- /// ``: | Some(Month::January) | Some(Month::February) | ... | Some(Month::December) - #[inline] fn from_u64(n: u64) -> Option { Self::from_u32(n as u32) @@ -279,7 +278,7 @@ mod month_serde { struct MonthVisitor; - impl<'de> de::Visitor<'de> for MonthVisitor { + impl de::Visitor<'_> for MonthVisitor { type Value = Month; fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/naive/date/mod.rs b/src/naive/date/mod.rs index bd70d52b31..1514518ab2 100644 --- a/src/naive/date/mod.rs +++ b/src/naive/date/mod.rs @@ -2406,7 +2406,7 @@ mod serde { inner: &'a D, } - impl<'a, D: fmt::Debug> fmt::Display for FormatWrapped<'a, D> { + impl fmt::Display for FormatWrapped<'_, D> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.inner.fmt(f) } @@ -2418,7 +2418,7 @@ mod serde { struct NaiveDateVisitor; - impl<'de> de::Visitor<'de> for NaiveDateVisitor { + impl de::Visitor<'_> for NaiveDateVisitor { type Value = NaiveDate; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/naive/datetime/serde.rs b/src/naive/datetime/serde.rs index ae06578b5c..85fcb94f29 100644 --- a/src/naive/datetime/serde.rs +++ b/src/naive/datetime/serde.rs @@ -15,7 +15,7 @@ impl ser::Serialize for NaiveDateTime { inner: &'a D, } - impl<'a, D: fmt::Debug> fmt::Display for FormatWrapped<'a, D> { + impl fmt::Display for FormatWrapped<'_, D> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.inner.fmt(f) } @@ -27,7 +27,7 @@ impl ser::Serialize for NaiveDateTime { struct NaiveDateTimeVisitor; -impl<'de> de::Visitor<'de> for NaiveDateTimeVisitor { +impl de::Visitor<'_> for NaiveDateTimeVisitor { type Value = NaiveDateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -161,7 +161,7 @@ pub mod ts_nanoseconds { pub(super) struct NanoSecondsTimestampVisitor; - impl<'de> de::Visitor<'de> for NanoSecondsTimestampVisitor { + impl de::Visitor<'_> for NanoSecondsTimestampVisitor { type Value = NaiveDateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -443,7 +443,7 @@ pub mod ts_microseconds { pub(super) struct MicroSecondsTimestampVisitor; - impl<'de> de::Visitor<'de> for MicroSecondsTimestampVisitor { + impl de::Visitor<'_> for MicroSecondsTimestampVisitor { type Value = NaiveDateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -713,7 +713,7 @@ pub mod ts_milliseconds { pub(super) struct MilliSecondsTimestampVisitor; - impl<'de> de::Visitor<'de> for MilliSecondsTimestampVisitor { + impl de::Visitor<'_> for MilliSecondsTimestampVisitor { type Value = NaiveDateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -968,7 +968,7 @@ pub mod ts_seconds { pub(super) struct SecondsTimestampVisitor; - impl<'de> de::Visitor<'de> for SecondsTimestampVisitor { + impl de::Visitor<'_> for SecondsTimestampVisitor { type Value = NaiveDateTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/naive/time/serde.rs b/src/naive/time/serde.rs index c1df410292..f9b1dde215 100644 --- a/src/naive/time/serde.rs +++ b/src/naive/time/serde.rs @@ -16,7 +16,7 @@ impl ser::Serialize for NaiveTime { struct NaiveTimeVisitor; -impl<'de> de::Visitor<'de> for NaiveTimeVisitor { +impl de::Visitor<'_> for NaiveTimeVisitor { type Value = NaiveTime; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/weekday.rs b/src/weekday.rs index 5c62ea3ed9..92644e8f6a 100644 --- a/src/weekday.rs +++ b/src/weekday.rs @@ -276,7 +276,7 @@ mod weekday_serde { struct WeekdayVisitor; - impl<'de> de::Visitor<'de> for WeekdayVisitor { + impl de::Visitor<'_> for WeekdayVisitor { type Value = Weekday; fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { From 22a56d704e7b7d34d4c8fd1a2c0d970f6a436b9f Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 29 Nov 2024 10:42:22 +0100 Subject: [PATCH 2/2] Update licenses for unicode-ident 1.0.14 --- deny.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index 105cc4ebc6..c9121c1f0e 100644 --- a/deny.toml +++ b/deny.toml @@ -1,5 +1,5 @@ [licenses] -allow = ["Apache-2.0", "MIT", "Unicode-DFS-2016"] +allow = ["Apache-2.0", "MIT", "Unicode-3.0"] private = { ignore = true } [advisories]