@@ -452,8 +452,10 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
452
452
| ast:: ExprKind :: While ( ..)
453
453
| ast:: ExprKind :: If ( ..)
454
454
| ast:: ExprKind :: Block ( ..)
455
+ | ast:: ExprKind :: Async ( ..)
455
456
| ast:: ExprKind :: Loop ( ..)
456
457
| ast:: ExprKind :: ForLoop ( ..)
458
+ | ast:: ExprKind :: TryBlock ( ..)
457
459
| ast:: ExprKind :: Match ( ..) => repr. contains ( '\n' ) ,
458
460
ast:: ExprKind :: Paren ( ref expr)
459
461
| ast:: ExprKind :: Binary ( _, _, ref expr)
@@ -466,7 +468,25 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
466
468
ast:: ExprKind :: Lit ( _) => {
467
469
repr. contains ( '\n' ) && trimmed_last_line_width ( repr) <= context. config . tab_spaces ( )
468
470
}
469
- _ => false ,
471
+ ast:: ExprKind :: AddrOf ( ..)
472
+ | ast:: ExprKind :: Assign ( ..)
473
+ | ast:: ExprKind :: AssignOp ( ..)
474
+ | ast:: ExprKind :: Await ( ..)
475
+ | ast:: ExprKind :: Box ( ..)
476
+ | ast:: ExprKind :: Break ( ..)
477
+ | ast:: ExprKind :: Cast ( ..)
478
+ | ast:: ExprKind :: Continue ( ..)
479
+ | ast:: ExprKind :: Err
480
+ | ast:: ExprKind :: Field ( ..)
481
+ | ast:: ExprKind :: InlineAsm ( ..)
482
+ | ast:: ExprKind :: Let ( ..)
483
+ | ast:: ExprKind :: Path ( ..)
484
+ | ast:: ExprKind :: Range ( ..)
485
+ | ast:: ExprKind :: Repeat ( ..)
486
+ | ast:: ExprKind :: Ret ( ..)
487
+ | ast:: ExprKind :: Tup ( ..)
488
+ | ast:: ExprKind :: Type ( ..)
489
+ | ast:: ExprKind :: Yield ( None ) => false ,
470
490
}
471
491
}
472
492
0 commit comments