aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
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_hir/src/nameres
parent7e0fa715329571da8d5d551b1815303c39cf51c1 (diff)
Remove redundant clone()
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/collector.rs2
-rw-r--r--crates/ra_hir/src/nameres/raw.rs5
2 files changed, 2 insertions, 5 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs
index 6b253ac40..ef7dc6ebe 100644
--- a/crates/ra_hir/src/nameres/collector.rs
+++ b/crates/ra_hir/src/nameres/collector.rs
@@ -166,7 +166,7 @@ where
166 // In Rust, `#[macro_export]` macros are unconditionally visible at the 166 // In Rust, `#[macro_export]` macros are unconditionally visible at the
167 // crate root, even if the parent modules is **not** visible. 167 // crate root, even if the parent modules is **not** visible.
168 if export { 168 if export {
169 self.update(self.def_map.root, None, &[(name.clone(), Resolution::from_macro(macro_))]); 169 self.update(self.def_map.root, None, &[(name, Resolution::from_macro(macro_))]);
170 } 170 }
171 } 171 }
172 172
diff --git a/crates/ra_hir/src/nameres/raw.rs b/crates/ra_hir/src/nameres/raw.rs
index 8bf883ac2..29aaddbf1 100644
--- a/crates/ra_hir/src/nameres/raw.rs
+++ b/crates/ra_hir/src/nameres/raw.rs
@@ -36,10 +36,7 @@ type ImportSource = Either<ast::UseTree, ast::ExternCrateItem>;
36 36
37impl ImportSourcePtr { 37impl ImportSourcePtr {
38 fn to_node(self, file: &SourceFile) -> ImportSource { 38 fn to_node(self, file: &SourceFile) -> ImportSource {
39 self.map( 39 self.map(|ptr| ptr.to_node(file.syntax()), |ptr| ptr.to_node(file.syntax()))
40 |ptr| ptr.to_node(file.syntax()).to_owned(),
41 |ptr| ptr.to_node(file.syntax()).to_owned(),
42 )
43 } 40 }
44} 41}
45 42