diff --git a/capnp/src/any_pointer_list.rs b/capnp/src/any_pointer_list.rs index 62f902a91..4edebc3a0 100644 --- a/capnp/src/any_pointer_list.rs +++ b/capnp/src/any_pointer_list.rs @@ -207,7 +207,7 @@ impl<'a> From> for crate::dynamic_value::Builder<'a> { } } -impl<'a> core::fmt::Debug for Reader<'a> { +impl core::fmt::Debug for Reader<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(*self), diff --git a/capnp/src/capability_list.rs b/capnp/src/capability_list.rs index 9923e4fa3..d8cd03985 100644 --- a/capnp/src/capability_list.rs +++ b/capnp/src/capability_list.rs @@ -70,7 +70,7 @@ where *self } } -impl<'a, T> Copy for Reader<'a, T> where T: FromClientHook {} +impl Copy for Reader<'_, T> where T: FromClientHook {} impl<'a, T> Reader<'a, T> where @@ -89,7 +89,7 @@ where } } -impl<'a, T> Reader<'a, T> +impl Reader<'_, T> where T: FromClientHook, { @@ -116,7 +116,7 @@ where } } -impl<'a, T> Reader<'a, T> +impl Reader<'_, T> where T: FromClientHook, { @@ -145,7 +145,7 @@ where } } -impl<'a, T> IndexMove> for Reader<'a, T> +impl IndexMove> for Reader<'_, T> where T: FromClientHook, { @@ -190,7 +190,7 @@ where } } -impl<'a, T> Builder<'a, T> +impl Builder<'_, T> where T: FromClientHook, { @@ -223,7 +223,7 @@ where } } -impl<'a, T> Builder<'a, T> +impl Builder<'_, T> where T: FromClientHook, { @@ -296,7 +296,7 @@ impl<'a, T: FromClientHook> From> for crate::dynamic_value::Build } } -impl<'a, T: FromClientHook> core::fmt::Debug for Reader<'a, T> { +impl core::fmt::Debug for Reader<'_, T> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(self.reborrow()), diff --git a/capnp/src/data_list.rs b/capnp/src/data_list.rs index e1d215e07..2bfc88808 100644 --- a/capnp/src/data_list.rs +++ b/capnp/src/data_list.rs @@ -248,7 +248,7 @@ impl<'a> crate::dynamic_value::DowncastBuilder<'a> for Builder<'a> { } } -impl<'a> core::fmt::Debug for Reader<'a> { +impl core::fmt::Debug for Reader<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(*self), diff --git a/capnp/src/dynamic_list.rs b/capnp/src/dynamic_list.rs index 0b620f145..b93097381 100644 --- a/capnp/src/dynamic_list.rs +++ b/capnp/src/dynamic_list.rs @@ -407,7 +407,7 @@ impl<'a> crate::traits::SetterInput for Reader<'a> { } } -impl<'a> core::fmt::Debug for Reader<'a> { +impl core::fmt::Debug for Reader<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(*self), diff --git a/capnp/src/dynamic_struct.rs b/capnp/src/dynamic_struct.rs index aecafc010..f464bc213 100644 --- a/capnp/src/dynamic_struct.rs +++ b/capnp/src/dynamic_struct.rs @@ -809,7 +809,7 @@ impl<'a> crate::traits::SetterInput for Reader<'a> { } } -impl<'a> core::fmt::Debug for Reader<'a> { +impl core::fmt::Debug for Reader<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(*self), diff --git a/capnp/src/enum_list.rs b/capnp/src/enum_list.rs index 646c48a72..91d382963 100644 --- a/capnp/src/enum_list.rs +++ b/capnp/src/enum_list.rs @@ -84,15 +84,15 @@ impl<'a, T: TryFrom> FromPointerReader<'a> for Reader< } } -impl<'a, T: TryFrom> - IndexMove> for Reader<'a, T> +impl> IndexMove> + for Reader<'_, T> { fn index_move(&self, index: u32) -> ::core::result::Result { self.get(index) } } -impl<'a, T: TryFrom> Reader<'a, T> { +impl> Reader<'_, T> { /// Gets the `T` at position `index`. Panics if `index` is greater than or /// equal to `len()`. pub fn get(&self, index: u32) -> ::core::result::Result { @@ -167,7 +167,7 @@ impl<'a, T: TryFrom> FromPointerBuilder<'a> for Builde } } -impl<'a, T: Into + TryFrom> Builder<'a, T> { +impl + TryFrom> Builder<'_, T> { /// Gets the `T` at position `index`. Panics if `index` is greater than or /// equal to `len()`. pub fn get(&self, index: u32) -> ::core::result::Result { @@ -292,8 +292,8 @@ impl<'a, T: TryFrom + crate::introspect::Introspect> } } -impl<'a, T: Copy + TryFrom + crate::introspect::Introspect> - core::fmt::Debug for Reader<'a, T> +impl + crate::introspect::Introspect> core::fmt::Debug + for Reader<'_, T> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( diff --git a/capnp/src/lib.rs b/capnp/src/lib.rs index 57f4a45b5..5c1241d48 100644 --- a/capnp/src/lib.rs +++ b/capnp/src/lib.rs @@ -638,7 +638,7 @@ impl<'a> core::ops::Deref for OutputSegments<'a> { } } -impl<'s> message::ReaderSegments for OutputSegments<'s> { +impl message::ReaderSegments for OutputSegments<'_> { fn get_segment(&self, id: u32) -> Option<&[u8]> { match self { OutputSegments::SingleSegment(s) => s.get(id as usize).copied(), diff --git a/capnp/src/list_list.rs b/capnp/src/list_list.rs index 5667d3412..e21c088eb 100644 --- a/capnp/src/list_list.rs +++ b/capnp/src/list_list.rs @@ -85,7 +85,7 @@ where } } -impl<'a, T> Copy for Reader<'a, T> where T: crate::traits::Owned {} +impl Copy for Reader<'_, T> where T: crate::traits::Owned {} impl<'a, T> IndexMove>> for Reader<'a, T> where @@ -182,7 +182,7 @@ where } } -impl<'a, T> Builder<'a, T> +impl Builder<'_, T> where T: crate::traits::Owned, { @@ -315,7 +315,7 @@ impl<'a, T: crate::traits::Owned> crate::dynamic_value::DowncastBuilder<'a> for } } -impl<'a, T: crate::traits::Owned> core::fmt::Debug for Reader<'a, T> { +impl core::fmt::Debug for Reader<'_, T> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(*self), diff --git a/capnp/src/message.rs b/capnp/src/message.rs index 60f57311f..9b1041fa5 100644 --- a/capnp/src/message.rs +++ b/capnp/src/message.rs @@ -189,7 +189,7 @@ impl<'a> SegmentArray<'a> { } } -impl<'b> ReaderSegments for SegmentArray<'b> { +impl ReaderSegments for SegmentArray<'_> { fn get_segment(&self, id: u32) -> Option<&[u8]> { self.segments.get(id as usize).copied() } @@ -199,7 +199,7 @@ impl<'b> ReaderSegments for SegmentArray<'b> { } } -impl<'b> ReaderSegments for [&'b [u8]] { +impl ReaderSegments for [&[u8]] { fn get_segment(&self, id: u32) -> Option<&[u8]> { self.get(id as usize).copied() } @@ -871,7 +871,7 @@ impl<'a> ScratchSpaceHeapAllocator<'a> { } #[cfg(feature = "alloc")] -unsafe impl<'a> Allocator for ScratchSpaceHeapAllocator<'a> { +unsafe impl Allocator for ScratchSpaceHeapAllocator<'_> { fn allocate_segment(&mut self, minimum_size: u32) -> (*mut u8, u32) { if (minimum_size as usize) < (self.scratch_space.len() / BYTES_PER_WORD) && !self.scratch_space_allocated @@ -953,7 +953,7 @@ impl<'a> SingleSegmentAllocator<'a> { } } -unsafe impl<'a> Allocator for SingleSegmentAllocator<'a> { +unsafe impl Allocator for SingleSegmentAllocator<'_> { fn allocate_segment(&mut self, minimum_size: u32) -> (*mut u8, u32) { let available_word_count = self.segment.len() / BYTES_PER_WORD; if (minimum_size as usize) > available_word_count { @@ -989,7 +989,7 @@ unsafe impl<'a> Allocator for SingleSegmentAllocator<'a> { } } -unsafe impl<'a, A> Allocator for &'a mut A +unsafe impl Allocator for &'_ mut A where A: Allocator, { diff --git a/capnp/src/primitive_list.rs b/capnp/src/primitive_list.rs index feabb9d0b..2cefafce6 100644 --- a/capnp/src/primitive_list.rs +++ b/capnp/src/primitive_list.rs @@ -88,13 +88,13 @@ impl<'a, T: PrimitiveElement> FromPointerReader<'a> for Reader<'a, T> { } } -impl<'a, T: PrimitiveElement> IndexMove for Reader<'a, T> { +impl IndexMove for Reader<'_, T> { fn index_move(&self, index: u32) -> T { self.get(index) } } -impl<'a, T: PrimitiveElement> Reader<'a, T> { +impl Reader<'_, T> { /// Gets the `T` at position `index`. Panics if `index` is greater than or /// equal to `len()`. pub fn get(&self, index: u32) -> T { @@ -248,7 +248,7 @@ impl<'a, T: PrimitiveElement> FromPointerBuilder<'a> for Builder<'a, T> { } } -impl<'a, T: PrimitiveElement> Builder<'a, T> { +impl Builder<'_, T> { /// Gets the `T` at position `index`. Panics if `index` is greater than or /// equal to `len()`. pub fn get(&self, index: u32) -> T { @@ -381,8 +381,8 @@ impl<'a, T: PrimitiveElement + crate::introspect::Introspect> } } -impl<'a, T: Copy + PrimitiveElement + crate::introspect::Introspect> core::fmt::Debug - for Reader<'a, T> +impl core::fmt::Debug + for Reader<'_, T> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( diff --git a/capnp/src/stringify.rs b/capnp/src/stringify.rs index d11bfbeb7..901bcd205 100644 --- a/capnp/src/stringify.rs +++ b/capnp/src/stringify.rs @@ -169,7 +169,7 @@ pub(crate) fn print( } } -impl<'a> fmt::Debug for dynamic_value::Reader<'a> { +impl fmt::Debug for dynamic_value::Reader<'_> { fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { let indent = if f.alternate() { Indent::enabled() diff --git a/capnp/src/struct_list.rs b/capnp/src/struct_list.rs index 55aba5d29..f683d7df6 100644 --- a/capnp/src/struct_list.rs +++ b/capnp/src/struct_list.rs @@ -71,7 +71,7 @@ where *self } } -impl<'a, T> Copy for Reader<'a, T> where T: crate::traits::OwnedStruct {} +impl Copy for Reader<'_, T> where T: crate::traits::OwnedStruct {} impl<'a, T> Reader<'a, T> where @@ -90,7 +90,7 @@ where } } -impl<'a, T> Reader<'a, T> +impl Reader<'_, T> where T: crate::traits::OwnedStruct, { @@ -201,7 +201,7 @@ where } } -impl<'a, T> Builder<'a, T> +impl Builder<'_, T> where T: crate::traits::OwnedStruct, { @@ -324,7 +324,7 @@ impl<'a, T: crate::traits::OwnedStruct> crate::dynamic_value::DowncastBuilder<'a } } -impl<'a, T: crate::traits::OwnedStruct> core::fmt::Debug for Reader<'a, T> { +impl core::fmt::Debug for Reader<'_, T> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(*self), diff --git a/capnp/src/text.rs b/capnp/src/text.rs index a47e93597..081fc71a4 100644 --- a/capnp/src/text.rs +++ b/capnp/src/text.rs @@ -63,7 +63,7 @@ impl<'a> core::cmp::PartialEq> for &'a str { } #[cfg(feature = "alloc")] -impl<'a> core::cmp::PartialEq for Reader<'a> { +impl core::cmp::PartialEq for Reader<'_> { #[inline] fn eq(&self, other: &alloc::string::String) -> bool { self.as_bytes() == other.as_bytes() @@ -92,7 +92,7 @@ impl<'a> core::cmp::PartialOrd> for &'a str { } } -impl<'a> core::fmt::Debug for Reader<'a> { +impl core::fmt::Debug for Reader<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self.to_str() { Ok(s) => write!(f, "{:?}", s), @@ -179,7 +179,7 @@ pub struct Builder<'a> { pos: usize, } -impl<'a> core::cmp::PartialEq for Builder<'a> { +impl core::cmp::PartialEq for Builder<'_> { fn eq(&self, other: &Self) -> bool { self.bytes == other.bytes } @@ -285,7 +285,7 @@ impl<'a> Builder<'a> { } } -impl<'a> core::fmt::Debug for Builder<'a> { +impl core::fmt::Debug for Builder<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self.reborrow_as_reader().to_str() { Ok(s) => write!(f, "{:?}", s), diff --git a/capnp/src/text_list.rs b/capnp/src/text_list.rs index 905012a29..7ea681265 100644 --- a/capnp/src/text_list.rs +++ b/capnp/src/text_list.rs @@ -283,7 +283,7 @@ impl<'a> crate::dynamic_value::DowncastBuilder<'a> for Builder<'a> { } } -impl<'a> core::fmt::Debug for Reader<'a> { +impl core::fmt::Debug for Reader<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt( &::core::convert::Into::>::into(*self),