mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Remove neesless clone
This commit is contained in:
parent
820393f72d
commit
b50cb5c261
8 changed files with 10 additions and 10 deletions
|
@ -47,7 +47,7 @@ pub(crate) fn goto_definition(
|
|||
.into_iter()
|
||||
.filter_map(|token| {
|
||||
let parent = token.parent()?;
|
||||
if let Some(tt) = ast::TokenTree::cast(parent.clone()) {
|
||||
if let Some(tt) = ast::TokenTree::cast(parent) {
|
||||
if let x @ Some(_) =
|
||||
try_lookup_include_path(&sema, tt, token.clone(), position.file_id)
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ fn try_lookup_include_path(
|
|||
token: SyntaxToken,
|
||||
file_id: FileId,
|
||||
) -> Option<Vec<NavigationTarget>> {
|
||||
let token = ast::String::cast(token.clone())?;
|
||||
let token = ast::String::cast(token)?;
|
||||
let path = token.value()?.into_owned();
|
||||
let macro_call = tt.syntax().parent().and_then(ast::MacroCall::cast)?;
|
||||
let name = macro_call.path()?.segment()?.name_ref()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue