mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Fix a few clippy::perf warnings
This commit is contained in:
parent
cc49502ab4
commit
f9bb398cc5
8 changed files with 14 additions and 12 deletions
|
@ -31,7 +31,7 @@ pub(crate) fn goto_definition(
|
|||
let original_token = pick_best(file.token_at_offset(position.offset))?;
|
||||
let token = sema.descend_into_macros(original_token.clone());
|
||||
let parent = token.parent();
|
||||
if let Some(comment) = ast::Comment::cast(token.clone()) {
|
||||
if let Some(comment) = ast::Comment::cast(token) {
|
||||
let nav = def_for_doc_comment(&sema, position, &comment)?.try_to_nav(db)?;
|
||||
return Some(RangeInfo::new(original_token.text_range(), vec![nav]));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue