cargo clippy --fix

This commit is contained in:
Johann Hemmann 2024-01-18 13:59:49 +01:00
parent 1ab8c7fd27
commit fad4fa163c
178 changed files with 595 additions and 738 deletions

View file

@ -130,11 +130,11 @@ pub(super) fn hints(
[(_, _, lifetime, _), ..] if self_param.is_some() || potential_lt_refs.len() == 1 => {
match lifetime {
Some(lt) => match lt.text().as_str() {
"'_" => allocated_lifetimes.get(0).cloned(),
"'_" => allocated_lifetimes.first().cloned(),
"'static" => None,
name => Some(name.into()),
},
None => allocated_lifetimes.get(0).cloned(),
None => allocated_lifetimes.first().cloned(),
}
}
[..] => None,

View file

@ -118,9 +118,8 @@ fn nearest_token_after_node(
token_type: syntax::SyntaxKind,
) -> Option<syntax::SyntaxToken> {
node.siblings_with_tokens(syntax::Direction::Next)
.filter_map(|it| it.as_token().map(|it| it.clone()))
.filter(|it| it.kind() == token_type)
.next()
.filter_map(|it| it.as_token().cloned())
.find(|it| it.kind() == token_type)
}
#[cfg(test)]