Skip to content

Commit

Permalink
chore: Fix errors reported by clippy beta
Browse files Browse the repository at this point in the history
This fixes errors like

    error: the following explicit lifetimes could be elided: 'a
  • Loading branch information
kjarosh committed Oct 16, 2024
1 parent ba191b3 commit ce1a922
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion swf/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion wstr/src/buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions wstr/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions wstr/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct Iter<'a> {
inner: Units<SliceIter<'a, u8>, SliceIter<'a, u16>>,
}

impl<'a> Iterator for Iter<'a> {
impl Iterator for Iter<'_> {
type Item = u16;

#[inline]
Expand All @@ -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<Self::Item> {
match &mut self.inner {
Expand All @@ -41,7 +41,7 @@ pub struct CharIndices<'a> {
start: usize,
}

impl<'a> Iterator for CharIndices<'a> {
impl Iterator for CharIndices<'_> {
type Item = (usize, Result<char, core::char::DecodeUtf16Error>);

#[inline]
Expand Down
4 changes: 2 additions & 2 deletions wstr/src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -255,7 +255,7 @@ impl<T: Copy + Eq> Predicate<T> for T {

pub struct AnyOf<'a, T>(&'a [T]);

impl<'a, T: Copy, U: Copy + Eq + TryFrom<T>> Predicate<T> for AnyOf<'a, U> {
impl<T: Copy, U: Copy + Eq + TryFrom<T>> Predicate<T> for AnyOf<'_, U> {
fn matches(&mut self, c: T) -> bool {
self.0.iter().any(|m| U::try_from(c).ok() == Some(*m))
}
Expand Down
2 changes: 1 addition & 1 deletion wstr/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::Item> {
let first = *self.src.get(self.index)?;
Expand Down

0 comments on commit ce1a922

Please sign in to comment.