aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast/mod.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-13 14:35:17 +0100
committerAleksey Kladov <[email protected]>2018-08-13 14:35:17 +0100
commit8ae56fa6d0e8a03d6ad75919d6be953f5fc27083 (patch)
treed93a4f3e1d279a27cc851546796bb488edfe2c65 /crates/libsyntax2/src/ast/mod.rs
parent7fc91f41d8bd948cef3085d7c0d0ec92d1b2bc53 (diff)
Stupid goto definition
Diffstat (limited to 'crates/libsyntax2/src/ast/mod.rs')
-rw-r--r--crates/libsyntax2/src/ast/mod.rs8
1 files changed, 8 insertions, 0 deletions
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<R: TreeRoot> Name<R> {
73 ident.leaf_text().unwrap() 73 ident.leaf_text().unwrap()
74 } 74 }
75} 75}
76
77impl<R: TreeRoot> NameRef<R> {
78 pub fn text(&self) -> SmolStr {
79 let ident = self.syntax().first_child()
80 .unwrap();
81 ident.leaf_text().unwrap()
82 }
83}