mirror of
https://github.com/chronotope/chrono.git
synced 2025-09-26 20:40:51 +00:00
Apply suggestions from clippy 1.83
This commit is contained in:
parent
1c7567b34d
commit
1456fa0977
@ -38,7 +38,7 @@ impl<Tz: TimeZone> ser::Serialize for DateTime<Tz> {
|
||||
inner: &'a DateTime<Tz>,
|
||||
}
|
||||
|
||||
impl<'a, Tz: TimeZone> fmt::Display for FormatIso8601<'a, Tz> {
|
||||
impl<Tz: TimeZone> 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<Tz: TimeZone> ser::Serialize for DateTime<Tz> {
|
||||
|
||||
struct DateTimeVisitor;
|
||||
|
||||
impl<'de> de::Visitor<'de> for DateTimeVisitor {
|
||||
impl de::Visitor<'_> for DateTimeVisitor {
|
||||
type Value = DateTime<FixedOffset>;
|
||||
|
||||
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<Utc>;
|
||||
|
||||
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<Utc>;
|
||||
|
||||
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<Utc>;
|
||||
|
||||
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<Utc>;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
|
@ -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> {
|
||||
|
@ -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<Month> {
|
||||
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 {
|
||||
|
@ -2406,7 +2406,7 @@ mod serde {
|
||||
inner: &'a D,
|
||||
}
|
||||
|
||||
impl<'a, D: fmt::Debug> fmt::Display for FormatWrapped<'a, D> {
|
||||
impl<D: fmt::Debug> 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 {
|
||||
|
@ -15,7 +15,7 @@ impl ser::Serialize for NaiveDateTime {
|
||||
inner: &'a D,
|
||||
}
|
||||
|
||||
impl<'a, D: fmt::Debug> fmt::Display for FormatWrapped<'a, D> {
|
||||
impl<D: fmt::Debug> 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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user