mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
more clippy fixes
This commit is contained in:
parent
3c468ab2fc
commit
35e5daacc3
19 changed files with 46 additions and 52 deletions
|
@ -49,13 +49,13 @@ pub(crate) fn goto_definition(
|
|||
let parent = token.parent()?;
|
||||
if let Some(tt) = ast::TokenTree::cast(parent) {
|
||||
if let x @ Some(_) =
|
||||
try_lookup_include_path(&sema, tt, token.clone(), position.file_id)
|
||||
try_lookup_include_path(sema, tt, token.clone(), position.file_id)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
}
|
||||
Some(
|
||||
Definition::from_token(&sema, &token)
|
||||
Definition::from_token(sema, &token)
|
||||
.into_iter()
|
||||
.flat_map(|def| {
|
||||
try_find_trait_item_definition(sema.db, &def)
|
||||
|
@ -145,7 +145,7 @@ mod tests {
|
|||
fn check(ra_fixture: &str) {
|
||||
let (analysis, position, expected) = fixture::annotations(ra_fixture);
|
||||
let navs = analysis.goto_definition(position).unwrap().expect("no definition found").info;
|
||||
if navs.len() == 0 {
|
||||
if navs.is_empty() {
|
||||
panic!("unresolved reference")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue