From fa6e0b0d38d2a030b959be91232927b9c096272b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 12:23:10 +0300 Subject: itroduce trait for ast tokens --- crates/ra_hir/src/name.rs | 4 ++-- crates/ra_hir/src/source_binder.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src') 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 { impl AsName for ast::NameRef { fn as_name(&self) -> Name { - Name::new(self.text()) + Name::new(self.text().clone()) } } impl AsName for ast::Name { fn as_name(&self) -> Name { - Name::new(self.text()) + Name::new(self.text().clone()) } } 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( if let Some(name) = trait_def.name() { let dst_range = name.syntax().range(); if let Some(src_range) = exp.map_range_back(dst_range) { - res.push((name.text(), src_range + off)) + res.push((name.text().clone(), src_range + off)) } } } -- cgit v1.2.3