diff options
author | Aleksey Kladov <[email protected]> | 2018-08-28 21:59:57 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-28 21:59:57 +0100 |
commit | 15f15d92eb4d6ab791047eefbd6dd9b2baba1140 (patch) | |
tree | 3f8fde6b53446c9ecfeac4f6bd2f34da5a91aa33 /crates/libsyntax2/src/ast/mod.rs | |
parent | ba02a55330d2ec9a0ea2c5cd457b82782ae299e9 (diff) |
add impl works with lifetimes
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() |