switch to upstream rowan's API

This commit is contained in:
Aleksey Kladov 2019-07-20 20:04:34 +03:00
parent 7bde8012cb
commit c9cfd57eea
22 changed files with 208 additions and 738 deletions

View file

@ -24,10 +24,7 @@ impl ast::NameRef {
}
fn text_of_first_token(node: &SyntaxNode) -> &SmolStr {
match node.0.green().children().first() {
Some(rowan::GreenElement::Token(it)) => it.text(),
_ => panic!(),
}
node.green().children().first().and_then(|it| it.as_token()).unwrap().text()
}
impl ast::Attr {