diff options
author | Aleksey Kladov <[email protected]> | 2019-01-08 09:23:10 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-08 09:23:10 +0000 |
commit | fa6e0b0d38d2a030b959be91232927b9c096272b (patch) | |
tree | 81b546c105388e1fc3154c90a42a8cc5fb930d0b /crates/ra_hir/src | |
parent | 3f4be819125ce4a22edd86721fa56b5caba99c2e (diff) |
itroduce trait for ast tokens
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/name.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir/src/name.rs b/crates/ra_hir/src/name.rs index dee1c9c5c..3e6ce8b95 100644 --- a/crates/ra_hir/src/name.rs +++ b/crates/ra_hir/src/name.rs | |||
@@ -76,13 +76,13 @@ pub(crate) trait AsName { | |||
76 | 76 | ||
77 | impl AsName for ast::NameRef { | 77 | impl AsName for ast::NameRef { |
78 | fn as_name(&self) -> Name { | 78 | fn as_name(&self) -> Name { |
79 | Name::new(self.text()) | 79 | Name::new(self.text().clone()) |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | impl AsName for ast::Name { | 83 | impl AsName for ast::Name { |
84 | fn as_name(&self) -> Name { | 84 | fn as_name(&self) -> Name { |
85 | Name::new(self.text()) | 85 | Name::new(self.text().clone()) |
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 82675c0e4..59a803761 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -177,7 +177,7 @@ pub fn macro_symbols( | |||
177 | if let Some(name) = trait_def.name() { | 177 | if let Some(name) = trait_def.name() { |
178 | let dst_range = name.syntax().range(); | 178 | let dst_range = name.syntax().range(); |
179 | if let Some(src_range) = exp.map_range_back(dst_range) { | 179 | if let Some(src_range) = exp.map_range_back(dst_range) { |
180 | res.push((name.text(), src_range + off)) | 180 | res.push((name.text().clone(), src_range + off)) |
181 | } | 181 | } |
182 | } | 182 | } |
183 | } | 183 | } |