From 15f15d92eb4d6ab791047eefbd6dd9b2baba1140 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 23:59:57 +0300 Subject: add impl works with lifetimes --- crates/libsyntax2/src/ast/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/libsyntax2/src/ast/mod.rs') 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> { } } +impl<'a> Lifetime<'a> { + pub fn text(&self) -> SmolStr { + self.syntax().leaf_text().unwrap() + } +} + impl<'a> Name<'a> { pub fn text(&self) -> SmolStr { let ident = self.syntax().first_child() -- cgit v1.2.3