Skip to content

Commit 7cd4694

Browse files
authored
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
1 parent de55623 commit 7cd4694

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/impls.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
macro_rules! impl_partial_eq {
22
($lhs:ty, $rhs:ty) => {
3-
impl<'a, 'b> PartialEq<$rhs> for $lhs {
3+
impl<'a> PartialEq<$rhs> for $lhs {
44
#[inline]
55
fn eq(&self, other: &$rhs) -> bool {
66
let other: &[u8] = other.as_ref();
77
PartialEq::eq(self.as_bytes(), other)
88
}
99
}
1010

11-
impl<'a, 'b> PartialEq<$lhs> for $rhs {
11+
impl<'a> PartialEq<$lhs> for $rhs {
1212
#[inline]
1313
fn eq(&self, other: &$lhs) -> bool {
1414
let this: &[u8] = self.as_ref();
@@ -20,15 +20,15 @@ macro_rules! impl_partial_eq {
2020

2121
macro_rules! impl_partial_eq_n {
2222
($lhs:ty, $rhs:ty) => {
23-
impl<'a, 'b, const N: usize> PartialEq<$rhs> for $lhs {
23+
impl<'a, const N: usize> PartialEq<$rhs> for $lhs {
2424
#[inline]
2525
fn eq(&self, other: &$rhs) -> bool {
2626
let other: &[u8] = other.as_ref();
2727
PartialEq::eq(self.as_bytes(), other)
2828
}
2929
}
3030

31-
impl<'a, 'b, const N: usize> PartialEq<$lhs> for $rhs {
31+
impl<'a, const N: usize> PartialEq<$lhs> for $rhs {
3232
#[inline]
3333
fn eq(&self, other: &$lhs) -> bool {
3434
let this: &[u8] = self.as_ref();
@@ -41,15 +41,15 @@ macro_rules! impl_partial_eq_n {
4141
#[cfg(feature = "alloc")]
4242
macro_rules! impl_partial_eq_cow {
4343
($lhs:ty, $rhs:ty) => {
44-
impl<'a, 'b> PartialEq<$rhs> for $lhs {
44+
impl<'a> PartialEq<$rhs> for $lhs {
4545
#[inline]
4646
fn eq(&self, other: &$rhs) -> bool {
4747
let other: &[u8] = (&**other).as_ref();
4848
PartialEq::eq(self.as_bytes(), other)
4949
}
5050
}
5151

52-
impl<'a, 'b> PartialEq<$lhs> for $rhs {
52+
impl<'a> PartialEq<$lhs> for $rhs {
5353
#[inline]
5454
fn eq(&self, other: &$lhs) -> bool {
5555
let this: &[u8] = (&**other).as_ref();
@@ -61,15 +61,15 @@ macro_rules! impl_partial_eq_cow {
6161

6262
macro_rules! impl_partial_ord {
6363
($lhs:ty, $rhs:ty) => {
64-
impl<'a, 'b> PartialOrd<$rhs> for $lhs {
64+
impl<'a> PartialOrd<$rhs> for $lhs {
6565
#[inline]
6666
fn partial_cmp(&self, other: &$rhs) -> Option<Ordering> {
6767
let other: &[u8] = other.as_ref();
6868
PartialOrd::partial_cmp(self.as_bytes(), other)
6969
}
7070
}
7171

72-
impl<'a, 'b> PartialOrd<$lhs> for $rhs {
72+
impl<'a> PartialOrd<$lhs> for $rhs {
7373
#[inline]
7474
fn partial_cmp(&self, other: &$lhs) -> Option<Ordering> {
7575
let this: &[u8] = self.as_ref();
@@ -81,15 +81,15 @@ macro_rules! impl_partial_ord {
8181

8282
macro_rules! impl_partial_ord_n {
8383
($lhs:ty, $rhs:ty) => {
84-
impl<'a, 'b, const N: usize> PartialOrd<$rhs> for $lhs {
84+
impl<'a, const N: usize> PartialOrd<$rhs> for $lhs {
8585
#[inline]
8686
fn partial_cmp(&self, other: &$rhs) -> Option<Ordering> {
8787
let other: &[u8] = other.as_ref();
8888
PartialOrd::partial_cmp(self.as_bytes(), other)
8989
}
9090
}
9191

92-
impl<'a, 'b, const N: usize> PartialOrd<$lhs> for $rhs {
92+
impl<'a, const N: usize> PartialOrd<$lhs> for $rhs {
9393
#[inline]
9494
fn partial_cmp(&self, other: &$lhs) -> Option<Ordering> {
9595
let this: &[u8] = self.as_ref();

0 commit comments

Comments
 (0)