aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/ast/mod.rs')
-rw-r--r--crates/libsyntax2/src/ast/mod.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/libsyntax2/src/ast/mod.rs b/crates/libsyntax2/src/ast/mod.rs
index 56bc099fe..e9362d048 100644
--- a/crates/libsyntax2/src/ast/mod.rs
+++ b/crates/libsyntax2/src/ast/mod.rs
@@ -1,6 +1,9 @@
1mod generated; 1mod generated;
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4
5use smol_str::SmolStr;
6
4use { 7use {
5 SyntaxNode, SyntaxRoot, TreeRoot, SyntaxError, 8 SyntaxNode, SyntaxRoot, TreeRoot, SyntaxError,
6 SyntaxKind::*, 9 SyntaxKind::*,
@@ -64,7 +67,9 @@ impl<R: TreeRoot> Function<R> {
64} 67}
65 68
66impl<R: TreeRoot> Name<R> { 69impl<R: TreeRoot> Name<R> {
67 pub fn text(&self) -> String { 70 pub fn text(&self) -> SmolStr {
68 self.syntax().text() 71 let ident = self.syntax().first_child()
72 .unwrap();
73 ident.leaf_text().unwrap()
69 } 74 }
70} 75}