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.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/ast/mod.rs b/crates/libsyntax2/src/ast/mod.rs
index 9941138a7..3b5e9269f 100644
--- a/crates/libsyntax2/src/ast/mod.rs
+++ b/crates/libsyntax2/src/ast/mod.rs
@@ -67,6 +67,12 @@ impl<'a> Attr<'a> {
67 } 67 }
68} 68}
69 69
70impl<'a> Lifetime<'a> {
71 pub fn text(&self) -> SmolStr {
72 self.syntax().leaf_text().unwrap()
73 }
74}
75
70impl<'a> Name<'a> { 76impl<'a> Name<'a> {
71 pub fn text(&self) -> SmolStr { 77 pub fn text(&self) -> SmolStr {
72 let ident = self.syntax().first_child() 78 let ident = self.syntax().first_child()