mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
align SyntaxText API with upstream
This commit is contained in:
parent
6b352ffeb3
commit
f6bcc2d745
9 changed files with 18 additions and 24 deletions
|
@ -36,7 +36,7 @@ fn prev_tokens(token: SyntaxToken) -> impl Iterator<Item = SyntaxToken> {
|
|||
|
||||
pub fn extract_trivial_expression(block: &ast::Block) -> Option<ast::Expr> {
|
||||
let expr = block.expr()?;
|
||||
if expr.syntax().text().contains('\n') {
|
||||
if expr.syntax().text().contains_char('\n') {
|
||||
return None;
|
||||
}
|
||||
let non_trivial_children = block.syntax().children().filter(|it| match it.kind() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue