From ce1a922478d9bc8b6d233d04141322a2abb0cfb7 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Wed, 16 Oct 2024 11:16:27 +0200 Subject: [PATCH] chore: Fix errors reported by clippy beta This fixes errors like error: the following explicit lifetimes could be elided: 'a --- swf/src/types.rs | 2 +- wstr/src/buf.rs | 2 +- wstr/src/common.rs | 4 ++-- wstr/src/ops.rs | 6 +++--- wstr/src/pattern.rs | 4 ++-- wstr/src/utils.rs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/swf/src/types.rs b/swf/src/types.rs index 79814a4ee0c5..77dacb2b905c 100644 --- a/swf/src/types.rs +++ b/swf/src/types.rs @@ -1575,7 +1575,7 @@ impl<'a> EditText<'a> { } } -impl<'a> Default for EditText<'a> { +impl Default for EditText<'_> { fn default() -> Self { Self { id: Default::default(), diff --git a/wstr/src/buf.rs b/wstr/src/buf.rs index 96b872a75a92..0fe0206f3caf 100644 --- a/wstr/src/buf.rs +++ b/wstr/src/buf.rs @@ -306,7 +306,7 @@ impl WString { } } - impl<'a> Drop for Guard<'a> { + impl Drop for Guard<'_> { fn drop(&mut self) { // SAFETY: something has gone wrong, replace the buffer with an empty one and drop it. unsafe { diff --git a/wstr/src/common.rs b/wstr/src/common.rs index fd816311f114..da92e5a22b64 100644 --- a/wstr/src/common.rs +++ b/wstr/src/common.rs @@ -473,14 +473,14 @@ impl WStr { } } -impl<'a> Default for &'a WStr { +impl Default for &WStr { #[inline] fn default() -> Self { WStr::empty() } } -impl<'a> Default for &'a mut WStr { +impl Default for &mut WStr { #[inline] fn default() -> Self { WStr::empty_mut() diff --git a/wstr/src/ops.rs b/wstr/src/ops.rs index 472263aa8888..6df7318410cd 100644 --- a/wstr/src/ops.rs +++ b/wstr/src/ops.rs @@ -12,7 +12,7 @@ pub struct Iter<'a> { inner: Units, SliceIter<'a, u16>>, } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = u16; #[inline] @@ -24,7 +24,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> DoubleEndedIterator for Iter<'a> { +impl DoubleEndedIterator for Iter<'_> { #[inline] fn next_back(&mut self) -> Option { match &mut self.inner { @@ -41,7 +41,7 @@ pub struct CharIndices<'a> { start: usize, } -impl<'a> Iterator for CharIndices<'a> { +impl Iterator for CharIndices<'_> { type Item = (usize, Result); #[inline] diff --git a/wstr/src/pattern.rs b/wstr/src/pattern.rs index a9b8ea5ebb01..741160bc6e0b 100644 --- a/wstr/src/pattern.rs +++ b/wstr/src/pattern.rs @@ -221,7 +221,7 @@ impl EmptySearcher { } } -impl<'a> Searcher<'a> for EmptySearcher { +impl Searcher<'_> for EmptySearcher { fn next(&mut self) -> SearchStep { match self.range.next() { Some(i) => SearchStep::Match(i, i), @@ -255,7 +255,7 @@ impl Predicate for T { pub struct AnyOf<'a, T>(&'a [T]); -impl<'a, T: Copy, U: Copy + Eq + TryFrom> Predicate for AnyOf<'a, U> { +impl> Predicate for AnyOf<'_, U> { fn matches(&mut self, c: T) -> bool { self.0.iter().any(|m| U::try_from(c).ok() == Some(*m)) } diff --git a/wstr/src/utils.rs b/wstr/src/utils.rs index 5d4fcac5f8f9..84ebc0759387 100644 --- a/wstr/src/utils.rs +++ b/wstr/src/utils.rs @@ -131,7 +131,7 @@ impl<'a> DecodeAvmUtf8<'a> { } } -impl<'a> Iterator for DecodeAvmUtf8<'a> { +impl Iterator for DecodeAvmUtf8<'_> { type Item = u32; fn next(&mut self) -> Option { let first = *self.src.get(self.index)?;