diff --git a/src/alloc.rs b/src/alloc.rs index 9ccb101..52c5272 100644 --- a/src/alloc.rs +++ b/src/alloc.rs @@ -68,13 +68,13 @@ impl<'bump> Deref for RefBump<'bump> { } } -impl<'bump> DerefMut for RefBump<'bump> { +impl DerefMut for RefBump<'_> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } -unsafe impl<'bump> Allocator for RefBump<'bump> { +unsafe impl Allocator for RefBump<'_> { #[inline] fn allocate( &self, @@ -139,27 +139,27 @@ unsafe impl<'bump> Allocator for RefBump<'bump> { #[derive(Debug)] pub struct RefStr<'bump>(pub Ref<'bump, str>); -impl<'bump> std::hash::Hash for RefStr<'bump> { +impl std::hash::Hash for RefStr<'_> { fn hash(&self, state: &mut H) { self.0.hash(state); } } -impl<'bump> PartialEq for RefStr<'bump> { +impl PartialEq for RefStr<'_> { fn eq(&self, other: &Self) -> bool { self.0.deref() == other.0.deref() } } -impl<'bump> Eq for RefStr<'bump> {} +impl Eq for RefStr<'_> {} -impl<'bump> Borrow for RefStr<'bump> { +impl Borrow for RefStr<'_> { fn borrow(&self) -> &str { self } } -impl<'bump> Deref for RefStr<'bump> { +impl Deref for RefStr<'_> { type Target = str; fn deref(&self) -> &Self::Target { @@ -167,7 +167,7 @@ impl<'bump> Deref for RefStr<'bump> { } } -impl<'bump> AsRef for RefStr<'bump> { +impl AsRef for RefStr<'_> { fn as_ref(&self) -> &str { self } @@ -177,27 +177,27 @@ impl<'bump> AsRef for RefStr<'bump> { #[derive(Debug)] pub struct RefBytes<'bump>(pub Ref<'bump, [u8]>); -impl<'bump> std::hash::Hash for RefBytes<'bump> { +impl std::hash::Hash for RefBytes<'_> { fn hash(&self, state: &mut H) { self.0.hash(state); } } -impl<'bump> PartialEq for RefBytes<'bump> { +impl PartialEq for RefBytes<'_> { fn eq(&self, other: &Self) -> bool { self.0.deref() == other.0.deref() } } -impl<'bump> Eq for RefBytes<'bump> {} +impl Eq for RefBytes<'_> {} -impl<'bump> Borrow<[u8]> for RefBytes<'bump> { +impl Borrow<[u8]> for RefBytes<'_> { fn borrow(&self) -> &[u8] { self } } -impl<'bump> Deref for RefBytes<'bump> { +impl Deref for RefBytes<'_> { type Target = [u8]; fn deref(&self) -> &Self::Target { @@ -205,7 +205,7 @@ impl<'bump> Deref for RefBytes<'bump> { } } -impl<'bump> AsRef<[u8]> for RefBytes<'bump> { +impl AsRef<[u8]> for RefBytes<'_> { fn as_ref(&self) -> &[u8] { self } diff --git a/src/map.rs b/src/map.rs index f4aad87..ba9466a 100644 --- a/src/map.rs +++ b/src/map.rs @@ -26,7 +26,7 @@ pub struct RawMap<'bump> { cache: hashbrown::HashMap<&'bump str, usize, DefaultHashBuilder, &'bump Bump>, } -impl<'bump> Serialize for RawMap<'bump> { +impl Serialize for RawMap<'_> { #[inline] fn serialize(&self, serializer: S) -> Result where diff --git a/src/map/frozen.rs b/src/map/frozen.rs index a5dfe68..5662d24 100644 --- a/src/map/frozen.rs +++ b/src/map/frozen.rs @@ -17,7 +17,7 @@ pub struct FrozenMap<'a, 'bump, K, V, S>(&'a mut hashbrown::HashMap Send for FrozenMap<'a, 'bump, K, V, S> +unsafe impl Send for FrozenMap<'_, '_, K, V, S> where K: Send, V: Send, @@ -81,7 +81,7 @@ impl<'a, 'bump, K, V, S> FrozenMap<'a, 'bump, K, V, S> { } } -impl<'a, 'bump, K, V, S> FrozenMap<'a, 'bump, K, V, S> +impl FrozenMap<'_, '_, K, V, S> where K: Eq + Hash, S: std::hash::BuildHasher, @@ -211,7 +211,7 @@ where } } -impl<'a, 'bump, K, V, S> FrozenMap<'a, 'bump, K, V, S> { +impl<'bump, K, V, S> FrozenMap<'_, 'bump, K, V, S> { /// Creates a raw immutable entry builder for the map. /// /// Raw entries provide the lowest level of control for searching and manipulating a map. They must be manually initialized with a hash and then manually searched. @@ -257,7 +257,7 @@ pub struct FrozenRawEntryBuilderMut<'a, 'bump, K, V, S>( RawEntryBuilderMut<'a, K, V, S, &'bump Bump>, ); -impl<'a, 'bump, K, V, S> FrozenRawEntryBuilderMut<'a, 'bump, K, V, S> { +impl<'a, K, V, S> FrozenRawEntryBuilderMut<'a, '_, K, V, S> { /// Creates a [`FrozenRawEntryBuilderMut`] from the given key. #[allow(clippy::wrong_self_convention)] // blame hashbrown #[inline] diff --git a/src/map/iter.rs b/src/map/iter.rs index ba7bbaa..75130d3 100644 --- a/src/map/iter.rs +++ b/src/map/iter.rs @@ -6,7 +6,7 @@ use crate::RawMap; /// /// Iterates in first-insertion order. pub struct Keys<'bump, 'a>(std::slice::Iter<'a, (&'bump str, &'bump RawValue)>); -impl<'a, 'bump> Iterator for Keys<'bump, 'a> { +impl<'bump> Iterator for Keys<'bump, '_> { type Item = &'bump str; #[inline] @@ -19,7 +19,7 @@ impl<'a, 'bump> Iterator for Keys<'bump, 'a> { /// /// Iterates in first-insertion order. pub struct Values<'bump, 'a>(std::slice::Iter<'a, (&'bump str, &'bump RawValue)>); -impl<'a, 'bump> Iterator for Values<'bump, 'a> { +impl<'bump> Iterator for Values<'bump, '_> { type Item = &'bump RawValue; #[inline] @@ -32,7 +32,7 @@ impl<'a, 'bump> Iterator for Values<'bump, 'a> { /// /// Iterates in first-insertion order. pub struct Iter<'bump, 'a>(std::slice::Iter<'a, (&'bump str, &'bump RawValue)>); -impl<'bump, 'a> Iterator for Iter<'bump, 'a> { +impl<'bump> Iterator for Iter<'bump, '_> { type Item = (&'bump str, &'bump RawValue); #[inline] diff --git a/src/test.rs b/src/test.rs index 5b3dcc5..acfcaa6 100644 --- a/src/test.rs +++ b/src/test.rs @@ -51,19 +51,19 @@ fn test_ref_allocator() { fn test_ref_map() { struct RefStr<'bump>(pub Ref<'bump, str>); - impl<'bump> std::hash::Hash for RefStr<'bump> { + impl std::hash::Hash for RefStr<'_> { fn hash(&self, state: &mut H) { self.0.hash(state); } } - impl<'bump> PartialEq for RefStr<'bump> { + impl PartialEq for RefStr<'_> { fn eq(&self, other: &Self) -> bool { self.0.deref() == other.0.deref() } } - impl<'bump> Eq for RefStr<'bump> {} + impl Eq for RefStr<'_> {} let bump = RefCell::new(Bump::new()); let bump_ref = RefBump::new(bump.borrow()); diff --git a/src/vec.rs b/src/vec.rs index c0aa16a..f0e88b1 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -14,7 +14,7 @@ pub mod iter; #[derive(Debug)] pub struct RawVec<'bump>(BVec<'bump, &'bump RawValue>); -impl<'bump> Serialize for RawVec<'bump> { +impl Serialize for RawVec<'_> { #[inline] fn serialize(&self, serializer: S) -> Result where diff --git a/src/vec/iter.rs b/src/vec/iter.rs index 5b83bee..0d19b24 100644 --- a/src/vec/iter.rs +++ b/src/vec/iter.rs @@ -4,7 +4,7 @@ use crate::RawVec; /// An iterator over the values of a [`RawVec`]. pub struct Iter<'bump, 'a>(std::slice::Iter<'a, &'bump RawValue>); -impl<'bump, 'a> Iterator for Iter<'bump, 'a> { +impl<'bump> Iterator for Iter<'bump, '_> { type Item = &'bump RawValue; #[inline]