mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Some clippy lints
This commit is contained in:
parent
5621f90071
commit
a82c679c97
10 changed files with 45 additions and 46 deletions
|
@ -166,7 +166,7 @@ pub(crate) fn find_all_refs(
|
|||
Some(RangeInfo::new(range, ReferenceSearchResult { declaration, references }))
|
||||
}
|
||||
|
||||
fn find_name<'a>(
|
||||
fn find_name(
|
||||
db: &RootDatabase,
|
||||
syntax: &SyntaxNode,
|
||||
position: FilePosition,
|
||||
|
@ -253,13 +253,10 @@ fn decl_access(
|
|||
let stmt = find_node_at_offset::<ast::LetStmt>(syntax, range.start())?;
|
||||
if let Some(_) = stmt.initializer() {
|
||||
let pat = stmt.pat()?;
|
||||
match pat {
|
||||
ast::Pat::BindPat(it) => {
|
||||
if it.name()?.text().as_str() == name {
|
||||
return Some(ReferenceAccess::Write);
|
||||
}
|
||||
if let ast::Pat::BindPat(it) = pat {
|
||||
if it.name()?.text().as_str() == name {
|
||||
return Some(ReferenceAccess::Write);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,7 +283,7 @@ fn reference_access(kind: &NameKind, name_ref: &ast::NameRef) -> Option<Referenc
|
|||
}
|
||||
}
|
||||
}
|
||||
return Some(ReferenceAccess::Read);
|
||||
Some(ReferenceAccess::Read)
|
||||
},
|
||||
_ => {None}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue