mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
cargo clippy --fix
This commit is contained in:
parent
1ab8c7fd27
commit
fad4fa163c
178 changed files with 595 additions and 738 deletions
|
@ -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,
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue