From 5e3f291195b580580be7ce5622f54ebca75fb9f0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 2 Sep 2019 21:23:19 +0300 Subject: fix hir for new block syntax --- crates/ra_fmt/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_fmt') diff --git a/crates/ra_fmt/src/lib.rs b/crates/ra_fmt/src/lib.rs index b09478d7a..e22ac9753 100644 --- a/crates/ra_fmt/src/lib.rs +++ b/crates/ra_fmt/src/lib.rs @@ -34,7 +34,8 @@ fn prev_tokens(token: SyntaxToken) -> impl Iterator { successors(token.prev_token(), |token| token.prev_token()) } -pub fn extract_trivial_expression(block: &ast::Block) -> Option { +pub fn extract_trivial_expression(expr: &ast::BlockExpr) -> Option { + let block = expr.block()?; let expr = block.expr()?; if expr.syntax().text().contains_char('\n') { return None; -- cgit v1.2.3