From 7cd46948f7c62ce4272b3df3341bb06fdeb20c5b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 2 Jan 2025 15:34:25 +0200 Subject: [PATCH] impl: remove unused 'b lifetime from trait implementation macros The macros implementing PartialEq and PartialOrd all provide lifetimes 'a and 'b to the types they receive, but none of the invocations of these macros ever use 'b. This was maybe a copy-and-paste gaffe? PR #202 --- src/impls.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/impls.rs b/src/impls.rs index 1c9614d..1b792dc 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -1,6 +1,6 @@ macro_rules! impl_partial_eq { ($lhs:ty, $rhs:ty) => { - impl<'a, 'b> PartialEq<$rhs> for $lhs { + impl<'a> PartialEq<$rhs> for $lhs { #[inline] fn eq(&self, other: &$rhs) -> bool { let other: &[u8] = other.as_ref(); @@ -8,7 +8,7 @@ macro_rules! impl_partial_eq { } } - impl<'a, 'b> PartialEq<$lhs> for $rhs { + impl<'a> PartialEq<$lhs> for $rhs { #[inline] fn eq(&self, other: &$lhs) -> bool { let this: &[u8] = self.as_ref(); @@ -20,7 +20,7 @@ macro_rules! impl_partial_eq { macro_rules! impl_partial_eq_n { ($lhs:ty, $rhs:ty) => { - impl<'a, 'b, const N: usize> PartialEq<$rhs> for $lhs { + impl<'a, const N: usize> PartialEq<$rhs> for $lhs { #[inline] fn eq(&self, other: &$rhs) -> bool { let other: &[u8] = other.as_ref(); @@ -28,7 +28,7 @@ macro_rules! impl_partial_eq_n { } } - impl<'a, 'b, const N: usize> PartialEq<$lhs> for $rhs { + impl<'a, const N: usize> PartialEq<$lhs> for $rhs { #[inline] fn eq(&self, other: &$lhs) -> bool { let this: &[u8] = self.as_ref(); @@ -41,7 +41,7 @@ macro_rules! impl_partial_eq_n { #[cfg(feature = "alloc")] macro_rules! impl_partial_eq_cow { ($lhs:ty, $rhs:ty) => { - impl<'a, 'b> PartialEq<$rhs> for $lhs { + impl<'a> PartialEq<$rhs> for $lhs { #[inline] fn eq(&self, other: &$rhs) -> bool { let other: &[u8] = (&**other).as_ref(); @@ -49,7 +49,7 @@ macro_rules! impl_partial_eq_cow { } } - impl<'a, 'b> PartialEq<$lhs> for $rhs { + impl<'a> PartialEq<$lhs> for $rhs { #[inline] fn eq(&self, other: &$lhs) -> bool { let this: &[u8] = (&**other).as_ref(); @@ -61,7 +61,7 @@ macro_rules! impl_partial_eq_cow { macro_rules! impl_partial_ord { ($lhs:ty, $rhs:ty) => { - impl<'a, 'b> PartialOrd<$rhs> for $lhs { + impl<'a> PartialOrd<$rhs> for $lhs { #[inline] fn partial_cmp(&self, other: &$rhs) -> Option { let other: &[u8] = other.as_ref(); @@ -69,7 +69,7 @@ macro_rules! impl_partial_ord { } } - impl<'a, 'b> PartialOrd<$lhs> for $rhs { + impl<'a> PartialOrd<$lhs> for $rhs { #[inline] fn partial_cmp(&self, other: &$lhs) -> Option { let this: &[u8] = self.as_ref(); @@ -81,7 +81,7 @@ macro_rules! impl_partial_ord { macro_rules! impl_partial_ord_n { ($lhs:ty, $rhs:ty) => { - impl<'a, 'b, const N: usize> PartialOrd<$rhs> for $lhs { + impl<'a, const N: usize> PartialOrd<$rhs> for $lhs { #[inline] fn partial_cmp(&self, other: &$rhs) -> Option { let other: &[u8] = other.as_ref(); @@ -89,7 +89,7 @@ macro_rules! impl_partial_ord_n { } } - impl<'a, 'b, const N: usize> PartialOrd<$lhs> for $rhs { + impl<'a, const N: usize> PartialOrd<$lhs> for $rhs { #[inline] fn partial_cmp(&self, other: &$lhs) -> Option { let this: &[u8] = self.as_ref();