Skip to content

Commit 96af9f7

Browse files
authored
Merge pull request #523 from newAM/fix-clippy-lints
Fix clippy needless_lifetimes lint
2 parents 0ebca23 + 07070cf commit 96af9f7

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

src/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ where
613613
}
614614
}
615615

616-
impl<'a, T> Drop for Hole<'a, T> {
616+
impl<T> Drop for Hole<'_, T> {
617617
#[inline]
618618
fn drop(&mut self) {
619619
// fill the hole again

src/deque.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -825,15 +825,15 @@ impl<'a, T> Iterator for Iter<'a, T> {
825825
}
826826
}
827827

828-
impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
828+
impl<T> DoubleEndedIterator for Iter<'_, T> {
829829
#[inline]
830830
fn next_back(&mut self) -> Option<Self::Item> {
831831
self.inner.next_back()
832832
}
833833
}
834834

835-
impl<'a, T> ExactSizeIterator for Iter<'a, T> {}
836-
impl<'a, T> FusedIterator for Iter<'a, T> {}
835+
impl<T> ExactSizeIterator for Iter<'_, T> {}
836+
impl<T> FusedIterator for Iter<'_, T> {}
837837

838838
impl<'a, T> Iterator for IterMut<'a, T> {
839839
type Item = &'a mut T;
@@ -847,15 +847,15 @@ impl<'a, T> Iterator for IterMut<'a, T> {
847847
}
848848
}
849849

850-
impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
850+
impl<T> DoubleEndedIterator for IterMut<'_, T> {
851851
#[inline]
852852
fn next_back(&mut self) -> Option<Self::Item> {
853853
self.inner.next_back()
854854
}
855855
}
856856

857-
impl<'a, T> ExactSizeIterator for IterMut<'a, T> {}
858-
impl<'a, T> FusedIterator for IterMut<'a, T> {}
857+
impl<T> ExactSizeIterator for IterMut<'_, T> {}
858+
impl<T> FusedIterator for IterMut<'_, T> {}
859859

860860
// Trait implementations
861861

src/histbuf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl<'a, T> OldestOrderedView<'a, T> {
534534
}
535535
}
536536

537-
impl<'a, T, S: Storage> Clone for OldestOrderedInner<'a, T, S> {
537+
impl<T, S: Storage> Clone for OldestOrderedInner<'_, T, S> {
538538
fn clone(&self) -> Self {
539539
Self {
540540
phantom: PhantomData,
@@ -555,7 +555,7 @@ impl<'a, T, S: Storage> Iterator for OldestOrderedInner<'a, T, S> {
555555
}
556556
}
557557

558-
impl<'a, T, const N: usize> DoubleEndedIterator for OldestOrdered<'a, T, N> {
558+
impl<T, const N: usize> DoubleEndedIterator for OldestOrdered<'_, T, N> {
559559
fn next_back(&mut self) -> Option<Self::Item> {
560560
self.inner.next_back()
561561
}

src/indexmap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ where
11831183
}
11841184
}
11851185

1186-
impl<'a, K, Q, V, S, const N: usize> ops::Index<&'a Q> for IndexMap<K, V, S, N>
1186+
impl<K, Q, V, S, const N: usize> ops::Index<&Q> for IndexMap<K, V, S, N>
11871187
where
11881188
K: Eq + Hash + Borrow<Q>,
11891189
Q: ?Sized + Eq + Hash,
@@ -1196,7 +1196,7 @@ where
11961196
}
11971197
}
11981198

1199-
impl<'a, K, Q, V, S, const N: usize> ops::IndexMut<&'a Q> for IndexMap<K, V, S, N>
1199+
impl<K, Q, V, S, const N: usize> ops::IndexMut<&Q> for IndexMap<K, V, S, N>
12001200
where
12011201
K: Eq + Hash + Borrow<Q>,
12021202
Q: ?Sized + Eq + Hash,
@@ -1259,7 +1259,7 @@ where
12591259
self.len() == other.len()
12601260
&& self
12611261
.iter()
1262-
.all(|(key, value)| other.get(key).map_or(false, |v| *value == *v))
1262+
.all(|(key, value)| other.get(key).is_some_and(|v| *value == *v))
12631263
}
12641264
}
12651265

@@ -1373,7 +1373,7 @@ impl<'a, K, V> Iterator for Iter<'a, K, V> {
13731373
}
13741374
}
13751375

1376-
impl<'a, K, V> Clone for Iter<'a, K, V> {
1376+
impl<K, V> Clone for Iter<'_, K, V> {
13771377
fn clone(&self) -> Self {
13781378
Self {
13791379
iter: self.iter.clone(),

src/indexset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ impl<'a, T> Iterator for Iter<'a, T> {
621621
}
622622
}
623623

624-
impl<'a, T> Clone for Iter<'a, T> {
624+
impl<T> Clone for Iter<'_, T> {
625625
fn clone(&self) -> Self {
626626
Self {
627627
iter: self.iter.clone(),

src/linear_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ where
392392
}
393393
}
394394

395-
impl<'a, K, V, Q, S: Storage> ops::Index<&'a Q> for LinearMapInner<K, V, S>
395+
impl<K, V, Q, S: Storage> ops::Index<&Q> for LinearMapInner<K, V, S>
396396
where
397397
K: Borrow<Q> + Eq,
398398
Q: Eq + ?Sized,
@@ -404,7 +404,7 @@ where
404404
}
405405
}
406406

407-
impl<'a, K, V, Q, S: Storage> ops::IndexMut<&'a Q> for LinearMapInner<K, V, S>
407+
impl<K, V, Q, S: Storage> ops::IndexMut<&Q> for LinearMapInner<K, V, S>
408408
where
409409
K: Borrow<Q> + Eq,
410410
Q: Eq + ?Sized,
@@ -550,7 +550,7 @@ where
550550
self.len() == other.len()
551551
&& self
552552
.iter()
553-
.all(|(key, value)| other.get(key).map_or(false, |v| *value == *v))
553+
.all(|(key, value)| other.get(key).is_some_and(|v| *value == *v))
554554
}
555555
}
556556

src/sorted_linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ pub type FindMut<'a, T, Idx, K, const N: usize> = FindMutInner<'a, T, Idx, K, Ow
607607
/// Comes from [`SortedLinkedList::find_mut`].
608608
pub type FindMutView<'a, T, Idx, K, const N: usize> = FindMutInner<'a, T, Idx, K, ViewStorage>;
609609

610-
impl<'a, T, Idx, K, S> FindMutInner<'a, T, Idx, K, S>
610+
impl<T, Idx, K, S> FindMutInner<'_, T, Idx, K, S>
611611
where
612612
T: Ord,
613613
Idx: SortedLinkedListIndex,

src/spsc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ pub type Iter<'a, T, const N: usize> = IterInner<'a, T, OwnedStorage<N>>;
405405
/// An iterator over the items of a queue
406406
pub type IterView<'a, T> = IterInner<'a, T, ViewStorage>;
407407

408-
impl<'a, T, const N: usize> Clone for Iter<'a, T, N> {
408+
impl<T, const N: usize> Clone for Iter<'_, T, N> {
409409
fn clone(&self) -> Self {
410410
Self {
411411
rb: self.rb,
@@ -465,7 +465,7 @@ impl<'a, T, S: Storage> Iterator for IterMutInner<'a, T, S> {
465465
}
466466
}
467467

468-
impl<'a, T, S: Storage> DoubleEndedIterator for IterInner<'a, T, S> {
468+
impl<T, S: Storage> DoubleEndedIterator for IterInner<'_, T, S> {
469469
fn next_back(&mut self) -> Option<Self::Item> {
470470
if self.index < self.len {
471471
let head = self.rb.head.load(Ordering::Relaxed);
@@ -480,7 +480,7 @@ impl<'a, T, S: Storage> DoubleEndedIterator for IterInner<'a, T, S> {
480480
}
481481
}
482482

483-
impl<'a, T, S: Storage> DoubleEndedIterator for IterMutInner<'a, T, S> {
483+
impl<T, S: Storage> DoubleEndedIterator for IterMutInner<'_, T, S> {
484484
fn next_back(&mut self) -> Option<Self::Item> {
485485
if self.index < self.len {
486486
let head = self.rb.head.load(Ordering::Relaxed);
@@ -562,7 +562,7 @@ pub type Consumer<'a, T, const N: usize> = ConsumerInner<'a, T, OwnedStorage<N>>
562562
/// NOTE the consumer semantically owns the `head` pointer of the queue
563563
pub type ConsumerView<'a, T> = ConsumerInner<'a, T, ViewStorage>;
564564

565-
unsafe impl<'a, T, S: Storage> Send for ConsumerInner<'a, T, S> where T: Send {}
565+
unsafe impl<T, S: Storage> Send for ConsumerInner<'_, T, S> where T: Send {}
566566

567567
/// Base struct for [`Producer`] and [`ProducerView`], generic over the [`Storage`].
568568
///
@@ -580,9 +580,9 @@ pub type Producer<'a, T, const N: usize> = ProducerInner<'a, T, OwnedStorage<N>>
580580
/// NOTE the producer semantically owns the `tail` pointer of the queue
581581
pub type ProducerView<'a, T> = ProducerInner<'a, T, ViewStorage>;
582582

583-
unsafe impl<'a, T, S: Storage> Send for ProducerInner<'a, T, S> where T: Send {}
583+
unsafe impl<T, S: Storage> Send for ProducerInner<'_, T, S> where T: Send {}
584584

585-
impl<'a, T, S: Storage> ConsumerInner<'a, T, S> {
585+
impl<T, S: Storage> ConsumerInner<'_, T, S> {
586586
/// Returns the item in the front of the queue, or `None` if the queue is empty
587587
#[inline]
588588
pub fn dequeue(&mut self) -> Option<T> {
@@ -657,7 +657,7 @@ impl<'a, T, S: Storage> ConsumerInner<'a, T, S> {
657657
}
658658
}
659659

660-
impl<'a, T, S: Storage> ProducerInner<'a, T, S> {
660+
impl<T, S: Storage> ProducerInner<'_, T, S> {
661661
/// Adds an `item` to the end of the queue, returns back the `item` if the queue is full
662662
#[inline]
663663
pub fn enqueue(&mut self, val: T) -> Result<(), T> {

src/string/drain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Drop for Drain<'_> {
4141
}
4242
}
4343

44-
impl<'a> Drain<'a> {
44+
impl Drain<'_> {
4545
/// Returns the remaining (sub)string of this iterator as a slice.
4646
///
4747
/// # Examples

src/vec/drain.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl<T: fmt::Debug> fmt::Debug for Drain<'_, T> {
3737
}
3838
}
3939

40-
impl<'a, T> Drain<'a, T> {
40+
impl<T> Drain<'_, T> {
4141
/// Returns the remaining items of this iterator as a slice.
4242
///
4343
/// # Examples
@@ -57,7 +57,7 @@ impl<'a, T> Drain<'a, T> {
5757
}
5858
}
5959

60-
impl<'a, T> AsRef<[T]> for Drain<'a, T> {
60+
impl<T> AsRef<[T]> for Drain<'_, T> {
6161
fn as_ref(&self) -> &[T] {
6262
self.as_slice()
6363
}
@@ -95,7 +95,7 @@ impl<T> Drop for Drain<'_, T> {
9595
/// Moves back the un-`Drain`ed elements to restore the original `Vec`.
9696
struct DropGuard<'r, 'a, T>(&'r mut Drain<'a, T>);
9797

98-
impl<'r, 'a, T> Drop for DropGuard<'r, 'a, T> {
98+
impl<T> Drop for DropGuard<'_, '_, T> {
9999
fn drop(&mut self) {
100100
if self.0.tail_len > 0 {
101101
unsafe {

0 commit comments

Comments
 (0)