diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-09 12:00:55 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-09 12:00:55 +0100 |
commit | cfc127f52988cf4f95797cb355398e3af32632aa (patch) | |
tree | a974bfe4160a0cb0d49146b239d68cdb99a6566d /crates/ra_fmt/src | |
parent | 85956932872481cf4813c5e7794d981a9edb4623 (diff) | |
parent | 689661c95968cb438f8bd1f10ce0ee096287741b (diff) |
Merge #3911
3911: Genrate token accessors r=matklad a=matklad
bors r+
🤖
Co-authored-by: Luca Barbieri <[email protected]>
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_fmt/src')
-rw-r--r-- | crates/ra_fmt/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_fmt/src/lib.rs b/crates/ra_fmt/src/lib.rs index db27f9b83..0b4ba1bbe 100644 --- a/crates/ra_fmt/src/lib.rs +++ b/crates/ra_fmt/src/lib.rs | |||
@@ -60,10 +60,10 @@ pub fn extract_trivial_expression(block: &ast::BlockExpr) -> Option<ast::Expr> { | |||
60 | } else { | 60 | } else { |
61 | // Unwrap `{ continue; }` | 61 | // Unwrap `{ continue; }` |
62 | let (stmt,) = block.statements().next_tuple()?; | 62 | let (stmt,) = block.statements().next_tuple()?; |
63 | if has_anything_else(stmt.syntax()) { | ||
64 | return None; | ||
65 | } | ||
66 | if let ast::Stmt::ExprStmt(expr_stmt) = stmt { | 63 | if let ast::Stmt::ExprStmt(expr_stmt) = stmt { |
64 | if has_anything_else(expr_stmt.syntax()) { | ||
65 | return None; | ||
66 | } | ||
67 | let expr = expr_stmt.expr()?; | 67 | let expr = expr_stmt.expr()?; |
68 | match expr.syntax().kind() { | 68 | match expr.syntax().kind() { |
69 | CONTINUE_EXPR | BREAK_EXPR | RETURN_EXPR => return Some(expr), | 69 | CONTINUE_EXPR | BREAK_EXPR | RETURN_EXPR => return Some(expr), |