File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,10 @@ fn pick_pattern_and_expr_order(
253
253
254
254
fn is_empty_expr ( expr : & ast:: Expr ) -> bool {
255
255
match expr {
256
- ast:: Expr :: BlockExpr ( expr) => expr. is_empty ( ) ,
256
+ ast:: Expr :: BlockExpr ( expr) => match expr. stmt_list ( ) {
257
+ Some ( it) => it. statements ( ) . next ( ) . is_none ( ) && it. tail_expr ( ) . is_none ( ) ,
258
+ None => true ,
259
+ } ,
257
260
ast:: Expr :: TupleExpr ( expr) => expr. fields ( ) . next ( ) . is_none ( ) ,
258
261
_ => false ,
259
262
}
Original file line number Diff line number Diff line change @@ -58,9 +58,6 @@ impl ast::BlockExpr {
58
58
self . stmt_list ( ) . into_iter ( ) . flat_map ( |it| it. items ( ) )
59
59
}
60
60
61
- pub fn is_empty ( & self ) -> bool {
62
- self . statements ( ) . next ( ) . is_none ( ) && self . tail_expr ( ) . is_none ( )
63
- }
64
61
pub fn statements ( & self ) -> impl Iterator < Item = ast:: Stmt > {
65
62
self . stmt_list ( ) . into_iter ( ) . flat_map ( |it| it. statements ( ) )
66
63
}
You can’t perform that action at this time.
0 commit comments