diff options
author | Ville Penttinen <[email protected]> | 2019-03-07 18:58:41 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-03-07 18:58:41 +0000 |
commit | b168104d95d112d254512090db3bc35ebf0fd5c2 (patch) | |
tree | 10bfff78a34a476ca62fdc56af90fd77ffe2aba7 | |
parent | 5c0556c2caa2e896d20ab47f87dc88121eda8261 (diff) |
Use ast::Name::text() instead of name().syntax().text()
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 1c7d1f3fd..bf08f5203 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -227,7 +227,7 @@ impl NavigationTarget { | |||
227 | let mut string = | 227 | let mut string = |
228 | node.visibility().map(|v| format!("{} ", v.syntax().text())).unwrap_or_default(); | 228 | node.visibility().map(|v| format!("{} ", v.syntax().text())).unwrap_or_default(); |
229 | string.push_str(label); | 229 | string.push_str(label); |
230 | node.name()?.syntax().text().push_to(&mut string); | 230 | string.push_str(node.name()?.text().as_str()); |
231 | Some(string) | 231 | Some(string) |
232 | } | 232 | } |
233 | 233 | ||
@@ -241,7 +241,7 @@ impl NavigationTarget { | |||
241 | .visit(|node: &ast::ConstDef| visit_ascribed_node(node, "const ")) | 241 | .visit(|node: &ast::ConstDef| visit_ascribed_node(node, "const ")) |
242 | .visit(|node: &ast::StaticDef| visit_ascribed_node(node, "static ")) | 242 | .visit(|node: &ast::StaticDef| visit_ascribed_node(node, "static ")) |
243 | .visit(|node: &ast::NamedFieldDef| visit_ascribed_node(node, "")) | 243 | .visit(|node: &ast::NamedFieldDef| visit_ascribed_node(node, "")) |
244 | .visit(|node: &ast::EnumVariant| Some(node.name()?.syntax().text().to_string())) | 244 | .visit(|node: &ast::EnumVariant| Some(node.name()?.text().to_string())) |
245 | .accept(&node)? | 245 | .accept(&node)? |
246 | } | 246 | } |
247 | } | 247 | } |