From 9c45a9e58632966984a79e18aa5221efb65e0ead Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Wed, 25 Sep 2019 10:32:01 +0900 Subject: Remove redundant clone() --- crates/ra_ide_api/src/completion/completion_context.rs | 2 +- crates/ra_ide_api/src/completion/presentation.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide_api/src/completion') diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index 59bd3689b..57542152f 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs @@ -94,7 +94,7 @@ impl<'a> CompletionContext<'a> { // actual completion. let file = { let edit = AtomTextEdit::insert(offset, "intellijRulezz".to_string()); - original_parse.reparse(&edit).tree().to_owned() + original_parse.reparse(&edit).tree() }; // First, let's try to complete a reference to some declaration. diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index ad414412b..b8aa433c1 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs @@ -76,7 +76,7 @@ impl Completions { None, ), ScopeDef::MacroDef(mac) => { - self.add_macro(ctx, Some(local_name.clone()), *mac); + self.add_macro(ctx, Some(local_name), *mac); return; } ScopeDef::Unknown => { -- cgit v1.2.3