From 495c35b5df648aeac86153d7db0b0c7173837793 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sat, 28 Oct 2023 16:31:32 +0200 Subject: [PATCH] Remove redundant lifetimes from `impl` --- src/reader/stream_reader.rs | 8 ++++---- src/serde/de.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/reader/stream_reader.rs b/src/reader/stream_reader.rs index eb29deb..5e2ead6 100644 --- a/src/reader/stream_reader.rs +++ b/src/reader/stream_reader.rs @@ -1779,7 +1779,7 @@ struct NumberBytesValueReader<'j, R: Read> { restrict_number: bool, requires_borrowed_result: bool, } -impl<'j, R: Read> NumberBytesProvider for NumberBytesValueReader<'j, R> { +impl NumberBytesProvider for NumberBytesValueReader<'_, R> { fn consume_current_peek_next(&mut self) -> Result, ReaderError> { // Note: The first byte was not actually read by `BytesValueReader`, instead it was peeked by creator // of NumberBytesValueReader. However, consume it here to include it in the final value. @@ -1814,7 +1814,7 @@ struct SkippingNumberBytesReader<'j, R: Read> { json_reader: &'j mut JsonStreamReader, consumed_bytes: u32, } -impl<'j, R: Read> NumberBytesProvider for SkippingNumberBytesReader<'j, R> { +impl NumberBytesProvider for SkippingNumberBytesReader<'_, R> { fn consume_current_peek_next(&mut self) -> Result, ReaderIoError> { // Should not fail since last peek_byte() succeeded self.json_reader.skip_peeked_byte(); @@ -5197,7 +5197,7 @@ mod tests { } } - impl<'a> Read for DebuggableReader<'a> { + impl Read for DebuggableReader<'_> { fn read(&mut self, buf: &mut [u8]) -> std::io::Result { if self.has_read { return Ok(0); @@ -5213,7 +5213,7 @@ mod tests { } } - impl<'a> Debug for DebuggableReader<'a> { + impl Debug for DebuggableReader<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "debuggable-reader") } diff --git a/src/serde/de.rs b/src/serde/de.rs index 87cbf77..e1d4188 100644 --- a/src/serde/de.rs +++ b/src/serde/de.rs @@ -340,7 +340,7 @@ impl JsonReaderDeserializer<'_, R> { * TODO: In the documentation of the methods below use links when referring to other method, * e.g. [`deserialize_map`]; however, rustdoc seems to be unable to create links? */ -impl<'de, 's, 'a, R: JsonReader> Deserializer<'de> for &'s mut JsonReaderDeserializer<'a, R> { +impl<'de, R: JsonReader> Deserializer<'de> for &mut JsonReaderDeserializer<'_, R> { type Error = DeserializerError; /// Require the `Deserializer` to figure out how to drive the visitor based @@ -937,7 +937,7 @@ struct VariantAccess<'s, 'a, R: JsonReader> { consumed_variant_value: bool, } -impl<'de, 's, 'a, R: JsonReader> serde::de::EnumAccess<'de> for &mut VariantAccess<'s, 'a, R> { +impl<'de, R: JsonReader> serde::de::EnumAccess<'de> for &mut VariantAccess<'_, '_, R> { type Error = DeserializerError; type Variant = Self; @@ -1003,7 +1003,7 @@ struct UnitVariantAccess<'s, 'a, R: JsonReader> { consumed_variant_value: bool, } -impl<'de, 's, 'a, R: JsonReader> serde::de::EnumAccess<'de> for &mut UnitVariantAccess<'s, 'a, R> { +impl<'de, R: JsonReader> serde::de::EnumAccess<'de> for &mut UnitVariantAccess<'_, '_, R> { type Error = DeserializerError; type Variant = Self;