diff options
Diffstat (limited to 'crates/libsyntax2/src/ast/mod.rs')
-rw-r--r-- | crates/libsyntax2/src/ast/mod.rs | 6 |
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 | ||
70 | impl<'a> Lifetime<'a> { | ||
71 | pub fn text(&self) -> SmolStr { | ||
72 | self.syntax().leaf_text().unwrap() | ||
73 | } | ||
74 | } | ||
75 | |||
70 | impl<'a> Name<'a> { | 76 | impl<'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() |