aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorShotaro Yamada <[email protected]>2019-09-25 02:32:01 +0100
committerShotaro Yamada <[email protected]>2019-09-25 02:32:01 +0100
commit9c45a9e58632966984a79e18aa5221efb65e0ead (patch)
treec3c2af75fa7be376506bf0ffe23fe8cad9c6c402 /crates/ra_ide_api
parent7e0fa715329571da8d5d551b1815303c39cf51c1 (diff)
Remove redundant clone()
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/completion/completion_context.rs2
-rw-r--r--crates/ra_ide_api/src/completion/presentation.rs2
-rw-r--r--crates/ra_ide_api/src/diagnostics.rs2
-rw-r--r--crates/ra_ide_api/src/display/navigation_target.rs4
4 files changed, 5 insertions, 5 deletions
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> {
94 // actual completion. 94 // actual completion.
95 let file = { 95 let file = {
96 let edit = AtomTextEdit::insert(offset, "intellijRulezz".to_string()); 96 let edit = AtomTextEdit::insert(offset, "intellijRulezz".to_string());
97 original_parse.reparse(&edit).tree().to_owned() 97 original_parse.reparse(&edit).tree()
98 }; 98 };
99 99
100 // First, let's try to complete a reference to some declaration. 100 // 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 {
76 None, 76 None,
77 ), 77 ),
78 ScopeDef::MacroDef(mac) => { 78 ScopeDef::MacroDef(mac) => {
79 self.add_macro(ctx, Some(local_name.clone()), *mac); 79 self.add_macro(ctx, Some(local_name), *mac);
80 return; 80 return;
81 } 81 }
82 ScopeDef::Unknown => { 82 ScopeDef::Unknown => {
diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs
index 1ae152e5b..93e1e7c2d 100644
--- a/crates/ra_ide_api/src/diagnostics.rs
+++ b/crates/ra_ide_api/src/diagnostics.rs
@@ -86,7 +86,7 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic>
86 fix: Some(fix), 86 fix: Some(fix),
87 }) 87 })
88 }); 88 });
89 let source_file = db.parse(file_id).tree().to_owned(); 89 let source_file = db.parse(file_id).tree();
90 let src = 90 let src =
91 hir::Source { file_id: file_id.into(), ast: hir::ModuleSource::SourceFile(source_file) }; 91 hir::Source { file_id: file_id.into(), ast: hir::ModuleSource::SourceFile(source_file) };
92 if let Some(m) = hir::Module::from_definition(db, src) { 92 if let Some(m) = hir::Module::from_definition(db, src) {
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs
index 11f73ccfd..d3e774bd0 100644
--- a/crates/ra_ide_api/src/display/navigation_target.rs
+++ b/crates/ra_ide_api/src/display/navigation_target.rs
@@ -304,7 +304,7 @@ impl NavigationTarget {
304 304
305pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> { 305pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> {
306 let parse = db.parse(symbol.file_id); 306 let parse = db.parse(symbol.file_id);
307 let node = symbol.ptr.to_node(parse.tree().syntax()).to_owned(); 307 let node = symbol.ptr.to_node(parse.tree().syntax());
308 308
309 visitor() 309 visitor()
310 .visit(|it: ast::FnDef| it.doc_comment_text()) 310 .visit(|it: ast::FnDef| it.doc_comment_text())
@@ -326,7 +326,7 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option
326/// e.g. `struct Name`, `enum Name`, `fn Name` 326/// e.g. `struct Name`, `enum Name`, `fn Name`
327pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> { 327pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option<String> {
328 let parse = db.parse(symbol.file_id); 328 let parse = db.parse(symbol.file_id);
329 let node = symbol.ptr.to_node(parse.tree().syntax()).to_owned(); 329 let node = symbol.ptr.to_node(parse.tree().syntax());
330 330
331 visitor() 331 visitor()
332 .visit(|node: ast::FnDef| node.short_label()) 332 .visit(|node: ast::FnDef| node.short_label())