Skip to content

Commit d6393c2

Browse files
committed
Auto merge of #567 - clarfonthey:needless-lifetimes, r=Amanieu
Autofix `clippy::needless_lifetimes` lint New clippy lint that I noticed was triggering and decided to separate into its own PR. Very simple, just checks if the lifetime only shows up in the `impl` line and elides it if that's the case.
2 parents 970bae4 + a72e52b commit d6393c2

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/map.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,7 @@ impl<K: Debug, V: Debug, S, A: Allocator> Debug for OccupiedError<'_, K, V, S, A
30423042
}
30433043
}
30443044

3045-
impl<'a, K: Debug, V: Debug, S, A: Allocator> fmt::Display for OccupiedError<'a, K, V, S, A> {
3045+
impl<K: Debug, V: Debug, S, A: Allocator> fmt::Display for OccupiedError<'_, K, V, S, A> {
30463046
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
30473047
write!(
30483048
f,
@@ -3153,7 +3153,7 @@ impl<K, V, S, A: Allocator> IntoIterator for HashMap<K, V, S, A> {
31533153
}
31543154
}
31553155

3156-
impl<'a, K, V> Default for Iter<'a, K, V> {
3156+
impl<K, V> Default for Iter<'_, K, V> {
31573157
#[cfg_attr(feature = "inline-more", inline)]
31583158
fn default() -> Self {
31593159
Self {
@@ -3201,7 +3201,7 @@ impl<K, V> ExactSizeIterator for Iter<'_, K, V> {
32013201

32023202
impl<K, V> FusedIterator for Iter<'_, K, V> {}
32033203

3204-
impl<'a, K, V> Default for IterMut<'a, K, V> {
3204+
impl<K, V> Default for IterMut<'_, K, V> {
32053205
#[cfg_attr(feature = "inline-more", inline)]
32063206
fn default() -> Self {
32073207
Self {
@@ -3300,7 +3300,7 @@ impl<K: Debug, V: Debug, A: Allocator> fmt::Debug for IntoIter<K, V, A> {
33003300
}
33013301
}
33023302

3303-
impl<'a, K, V> Default for Keys<'a, K, V> {
3303+
impl<K, V> Default for Keys<'_, K, V> {
33043304
#[cfg_attr(feature = "inline-more", inline)]
33053305
fn default() -> Self {
33063306
Self {
@@ -3340,7 +3340,7 @@ impl<K, V> ExactSizeIterator for Keys<'_, K, V> {
33403340
}
33413341
impl<K, V> FusedIterator for Keys<'_, K, V> {}
33423342

3343-
impl<'a, K, V> Default for Values<'a, K, V> {
3343+
impl<K, V> Default for Values<'_, K, V> {
33443344
#[cfg_attr(feature = "inline-more", inline)]
33453345
fn default() -> Self {
33463346
Self {
@@ -3380,7 +3380,7 @@ impl<K, V> ExactSizeIterator for Values<'_, K, V> {
33803380
}
33813381
impl<K, V> FusedIterator for Values<'_, K, V> {}
33823382

3383-
impl<'a, K, V> Default for ValuesMut<'a, K, V> {
3383+
impl<K, V> Default for ValuesMut<'_, K, V> {
33843384
#[cfg_attr(feature = "inline-more", inline)]
33853385
fn default() -> Self {
33863386
Self {
@@ -3428,7 +3428,7 @@ impl<K, V: Debug> fmt::Debug for ValuesMut<'_, K, V> {
34283428
}
34293429
}
34303430

3431-
impl<'a, K, V, A: Allocator> Iterator for Drain<'a, K, V, A> {
3431+
impl<K, V, A: Allocator> Iterator for Drain<'_, K, V, A> {
34323432
type Item = (K, V);
34333433

34343434
#[cfg_attr(feature = "inline-more", inline)]

src/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ impl<'a, K> Iterator for Iter<'a, K> {
18121812
self.iter.fold(init, f)
18131813
}
18141814
}
1815-
impl<'a, K> ExactSizeIterator for Iter<'a, K> {
1815+
impl<K> ExactSizeIterator for Iter<'_, K> {
18161816
#[cfg_attr(feature = "inline-more", inline)]
18171817
fn len(&self) -> usize {
18181818
self.iter.len()

src/table.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ pub struct Iter<'a, T> {
19581958
marker: PhantomData<&'a T>,
19591959
}
19601960

1961-
impl<'a, T> Default for Iter<'a, T> {
1961+
impl<T> Default for Iter<'_, T> {
19621962
#[cfg_attr(feature = "inline-more", inline)]
19631963
fn default() -> Self {
19641964
Iter {
@@ -2031,7 +2031,7 @@ pub struct IterMut<'a, T> {
20312031
marker: PhantomData<&'a mut T>,
20322032
}
20332033

2034-
impl<'a, T> Default for IterMut<'a, T> {
2034+
impl<T> Default for IterMut<'_, T> {
20352035
#[cfg_attr(feature = "inline-more", inline)]
20362036
fn default() -> Self {
20372037
IterMut {
@@ -2100,7 +2100,7 @@ pub struct IterHash<'a, T> {
21002100
marker: PhantomData<&'a T>,
21012101
}
21022102

2103-
impl<'a, T> Default for IterHash<'a, T> {
2103+
impl<T> Default for IterHash<'_, T> {
21042104
#[cfg_attr(feature = "inline-more", inline)]
21052105
fn default() -> Self {
21062106
IterHash {
@@ -2166,7 +2166,7 @@ pub struct IterHashMut<'a, T> {
21662166
marker: PhantomData<&'a mut T>,
21672167
}
21682168

2169-
impl<'a, T> Default for IterHashMut<'a, T> {
2169+
impl<T> Default for IterHashMut<'_, T> {
21702170
#[cfg_attr(feature = "inline-more", inline)]
21712171
fn default() -> Self {
21722172
IterHashMut {

0 commit comments

Comments
 (0)