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(
253253
254254fn is_empty_expr ( expr : & ast:: Expr ) -> bool {
255255 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+ } ,
257260 ast:: Expr :: TupleExpr ( expr) => expr. fields ( ) . next ( ) . is_none ( ) ,
258261 _ => false ,
259262 }
Original file line number Diff line number Diff line change @@ -58,9 +58,6 @@ impl ast::BlockExpr {
5858 self . stmt_list ( ) . into_iter ( ) . flat_map ( |it| it. items ( ) )
5959 }
6060
61- pub fn is_empty ( & self ) -> bool {
62- self . statements ( ) . next ( ) . is_none ( ) && self . tail_expr ( ) . is_none ( )
63- }
6461 pub fn statements ( & self ) -> impl Iterator < Item = ast:: Stmt > {
6562 self . stmt_list ( ) . into_iter ( ) . flat_map ( |it| it. statements ( ) )
6663 }
You can’t perform that action at this time.
0 commit comments