Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Dec 23, 2024
1 parent 95928ef commit b061e78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,15 +710,15 @@ impl<'a, K, V> Iterator for CLruCacheIter<'a, K, V> {
}
}

impl<'a, K, V> DoubleEndedIterator for CLruCacheIter<'a, K, V> {
impl<K, V> DoubleEndedIterator for CLruCacheIter<'_, K, V> {
fn next_back(&mut self) -> Option<Self::Item> {
self.iter
.next_back()
.map(|(_, CLruNode { key, value })| (key.borrow(), value))
}
}

impl<'a, K, V> ExactSizeIterator for CLruCacheIter<'a, K, V> {
impl<K, V> ExactSizeIterator for CLruCacheIter<'_, K, V> {
fn len(&self) -> usize {
self.iter.len()
}
Expand Down Expand Up @@ -759,15 +759,15 @@ impl<'a, K, V> Iterator for CLruCacheIterMut<'a, K, V> {
}
}

impl<'a, K, V> DoubleEndedIterator for CLruCacheIterMut<'a, K, V> {
impl<K, V> DoubleEndedIterator for CLruCacheIterMut<'_, K, V> {
fn next_back(&mut self) -> Option<Self::Item> {
self.iter
.next_back()
.map(|(_, CLruNode { key, value })| (&*key, value))
}
}

impl<'a, K, V> ExactSizeIterator for CLruCacheIterMut<'a, K, V> {
impl<K, V> ExactSizeIterator for CLruCacheIterMut<'_, K, V> {
fn len(&self) -> usize {
self.iter.len()
}
Expand Down
10 changes: 5 additions & 5 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ pub(crate) struct FixedSizeListIter<'a, T> {
len: usize,
}

impl<'a, T> Clone for FixedSizeListIter<'a, T> {
impl<T> Clone for FixedSizeListIter<'_, T> {
fn clone(&self) -> Self {
Self {
list: self.list,
Expand Down Expand Up @@ -374,7 +374,7 @@ impl<'a, T> Iterator for FixedSizeListIter<'a, T> {
}
}

impl<'a, T> DoubleEndedIterator for FixedSizeListIter<'a, T> {
impl<T> DoubleEndedIterator for FixedSizeListIter<'_, T> {
fn next_back(&mut self) -> Option<Self::Item> {
if self.len > 0 {
let back = self.back;
Expand All @@ -388,7 +388,7 @@ impl<'a, T> DoubleEndedIterator for FixedSizeListIter<'a, T> {
}
}

impl<'a, T> ExactSizeIterator for FixedSizeListIter<'a, T> {
impl<T> ExactSizeIterator for FixedSizeListIter<'_, T> {
fn len(&self) -> usize {
self.size_hint().0
}
Expand Down Expand Up @@ -454,7 +454,7 @@ impl<'a, T> Iterator for FixedSizeListIterMut<'a, T> {
}
}

impl<'a, T> DoubleEndedIterator for FixedSizeListIterMut<'a, T> {
impl<T> DoubleEndedIterator for FixedSizeListIterMut<'_, T> {
#[allow(unsafe_code)]
fn next_back(&mut self) -> Option<Self::Item> {
if self.len > 0 {
Expand All @@ -481,7 +481,7 @@ impl<'a, T> DoubleEndedIterator for FixedSizeListIterMut<'a, T> {
}
}

impl<'a, T> ExactSizeIterator for FixedSizeListIterMut<'a, T> {
impl<T> ExactSizeIterator for FixedSizeListIterMut<'_, T> {
fn len(&self) -> usize {
self.size_hint().0
}
Expand Down

0 comments on commit b061e78

Please sign in to comment.