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_analysis/src/imp.rs | 2 +- crates/ra_analysis/src/symbol_index.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_analysis') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 8ac430e41..98554dd4c 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -115,7 +115,7 @@ impl db::RootDatabase { let name = ast_module.name().unwrap(); Ok(vec![NavigationTarget { file_id, - name: name.text(), + name: name.text().clone(), range: name.syntax().range(), kind: MODULE, ptr: None, diff --git a/crates/ra_analysis/src/symbol_index.rs b/crates/ra_analysis/src/symbol_index.rs index ed1796756..8dd15b40e 100644 --- a/crates/ra_analysis/src/symbol_index.rs +++ b/crates/ra_analysis/src/symbol_index.rs @@ -205,7 +205,7 @@ pub(crate) struct FileSymbol { fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, LocalSyntaxPtr)> { fn decl(node: &N) -> Option<(SmolStr, LocalSyntaxPtr)> { - let name = node.name()?.text(); + let name = node.name()?.text().clone(); let ptr = LocalSyntaxPtr::new(node.syntax()); Some((name, ptr)) } -- cgit v1.2.3