Adapt to a new rowan borrowing node API.

This commit is contained in:
Dawer 2021-05-06 10:06:52 +05:00
parent 52143f389f
commit dc4fa504ea
2 changed files with 2 additions and 2 deletions

View file

@ -555,7 +555,7 @@ impl SyntaxRewriter<'_> {
fn element_to_green(element: SyntaxElement) -> NodeOrToken<rowan::GreenNode, rowan::GreenToken> { fn element_to_green(element: SyntaxElement) -> NodeOrToken<rowan::GreenNode, rowan::GreenToken> {
match element { match element {
NodeOrToken::Node(it) => NodeOrToken::Node(it.green()), NodeOrToken::Node(it) => NodeOrToken::Node(it.green().into_owned()),
NodeOrToken::Token(it) => NodeOrToken::Token(it.green().to_owned()), NodeOrToken::Token(it) => NodeOrToken::Token(it.green().to_owned()),
} }
} }

View file

@ -572,7 +572,7 @@ fn ast_from_text<N: AstNode>(text: &str) -> N {
} }
fn unroot(n: SyntaxNode) -> SyntaxNode { fn unroot(n: SyntaxNode) -> SyntaxNode {
SyntaxNode::new_root(n.green()) SyntaxNode::new_root(n.green().into())
} }
pub mod tokens { pub mod tokens {