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.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/ast/mod.rs b/crates/libsyntax2/src/ast/mod.rs
index e9362d048..2e1fb2d1c 100644
--- a/crates/libsyntax2/src/ast/mod.rs
+++ b/crates/libsyntax2/src/ast/mod.rs
@@ -73,3 +73,11 @@ impl<R: TreeRoot> Name<R> {
73 ident.leaf_text().unwrap() 73 ident.leaf_text().unwrap()
74 } 74 }
75} 75}
76
77impl<R: TreeRoot> NameRef<R> {
78 pub fn text(&self) -> SmolStr {
79 let ident = self.syntax().first_child()
80 .unwrap();
81 ident.leaf_text().unwrap()
82 }
83}