From 8ae56fa6d0e8a03d6ad75919d6be953f5fc27083 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 13 Aug 2018 16:35:17 +0300 Subject: Stupid goto definition --- crates/libsyntax2/src/ast/mod.rs | 8 ++++++++ 1 file changed, 8 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 e9362d048..2e1fb2d1c 100644 --- a/crates/libsyntax2/src/ast/mod.rs +++ b/crates/libsyntax2/src/ast/mod.rs @@ -73,3 +73,11 @@ impl Name { ident.leaf_text().unwrap() } } + +impl NameRef { + pub fn text(&self) -> SmolStr { + let ident = self.syntax().first_child() + .unwrap(); + ident.leaf_text().unwrap() + } +} -- cgit v1.2.3