fix clippy needless lifetimes (#769)

+ ignore them for bevy where we often want explicitness
This commit is contained in:
Thierry Berger
2024-12-05 15:55:12 +01:00
committed by GitHub
parent bce786831c
commit 93bd37d814
14 changed files with 38 additions and 26 deletions

View File

@@ -965,7 +965,7 @@ impl<'a, T> Iterator for Iter<'a, T> {
}
}
impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
impl<T> DoubleEndedIterator for Iter<'_, T> {
fn next_back(&mut self) -> Option<Self::Item> {
loop {
match self.inner.next_back() {
@@ -993,13 +993,13 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
}
}
impl<'a, T> ExactSizeIterator for Iter<'a, T> {
impl<T> ExactSizeIterator for Iter<'_, T> {
fn len(&self) -> usize {
self.len
}
}
impl<'a, T> FusedIterator for Iter<'a, T> {}
impl<T> FusedIterator for Iter<'_, T> {}
impl<'a, T> IntoIterator for &'a mut Arena<T> {
type Item = (Index, &'a mut T);
@@ -1069,7 +1069,7 @@ impl<'a, T> Iterator for IterMut<'a, T> {
}
}
impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
impl<T> DoubleEndedIterator for IterMut<'_, T> {
fn next_back(&mut self) -> Option<Self::Item> {
loop {
match self.inner.next_back() {
@@ -1097,13 +1097,13 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
}
}
impl<'a, T> ExactSizeIterator for IterMut<'a, T> {
impl<T> ExactSizeIterator for IterMut<'_, T> {
fn len(&self) -> usize {
self.len
}
}
impl<'a, T> FusedIterator for IterMut<'a, T> {}
impl<T> FusedIterator for IterMut<'_, T> {}
/// An iterator that removes elements from the arena.
///
@@ -1135,7 +1135,7 @@ pub struct Drain<'a, T: 'a> {
inner: iter::Enumerate<vec::Drain<'a, Entry<T>>>,
}
impl<'a, T> Iterator for Drain<'a, T> {
impl<T> Iterator for Drain<'_, T> {
type Item = (Index, T);
fn next(&mut self) -> Option<Self::Item> {

View File

@@ -531,7 +531,7 @@ fn edges_walker_mut<E>(
EdgesWalkerMut { edges, next, dir }
}
impl<'a, E> EdgesWalkerMut<'a, E> {
impl<E> EdgesWalkerMut<'_, E> {
fn next_edge(&mut self) -> Option<&mut Edge<E>> {
self.next().map(|t| t.1)
}
@@ -630,7 +630,7 @@ impl<'a, E> Iterator for Edges<'a, E> {
// x
// }
impl<'a, E> Clone for Edges<'a, E> {
impl<E> Clone for Edges<'_, E> {
fn clone(&self) -> Self {
Edges {
skip_start: self.skip_start,
@@ -699,15 +699,15 @@ impl<'a, E: 'a> EdgeReference<'a, E> {
}
}
impl<'a, E> Clone for EdgeReference<'a, E> {
impl<E> Clone for EdgeReference<'_, E> {
fn clone(&self) -> Self {
*self
}
}
impl<'a, E> Copy for EdgeReference<'a, E> {}
impl<E> Copy for EdgeReference<'_, E> {}
impl<'a, E> PartialEq for EdgeReference<'a, E>
impl<E> PartialEq for EdgeReference<'_, E>
where
E: PartialEq,
{