aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/extensions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/extensions.rs')
-rw-r--r--crates/ra_syntax/src/ast/extensions.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs
index 753fc42c6..d4873b39a 100644
--- a/crates/ra_syntax/src/ast/extensions.rs
+++ b/crates/ra_syntax/src/ast/extensions.rs
@@ -24,10 +24,7 @@ impl ast::NameRef {
24} 24}
25 25
26fn text_of_first_token(node: &SyntaxNode) -> &SmolStr { 26fn text_of_first_token(node: &SyntaxNode) -> &SmolStr {
27 match node.0.green().children().first() { 27 node.green().children().first().and_then(|it| it.as_token()).unwrap().text()
28 Some(rowan::GreenElement::Token(it)) => it.text(),
29 _ => panic!(),
30 }
31} 28}
32 29
33impl ast::Attr { 30impl ast::Attr {