@@ -391,26 +391,22 @@ pub(crate) fn rewrite_last_closure(
391
391
392
392
// We force to use block for the body of the closure for certain kinds of expressions.
393
393
if is_block_closure_forced ( context, body) {
394
- return rewrite_closure_with_block ( body, & prefix, context, body_shape) . map (
395
- |body_str| {
396
- match fn_decl. output {
397
- ast:: FnRetTy :: Default ( ..) if body_str. lines ( ) . count ( ) <= 7 => {
398
- // If the expression can fit in a single line, we need not force block
399
- // closure. However, if the closure has a return type, then we must
400
- // keep the blocks.
401
- match rewrite_closure_expr ( body, & prefix, context, shape) {
402
- Some ( single_line_body_str)
403
- if !single_line_body_str. contains ( '\n' ) =>
404
- {
405
- single_line_body_str
406
- }
407
- _ => body_str,
394
+ return rewrite_closure_with_block ( body, & prefix, context, body_shape) . map ( |body_str| {
395
+ match fn_decl. output {
396
+ ast:: FnRetTy :: Default ( ..) if body_str. lines ( ) . count ( ) <= 7 => {
397
+ // If the expression can fit in a single line, we need not force block
398
+ // closure. However, if the closure has a return type, then we must
399
+ // keep the blocks.
400
+ match rewrite_closure_expr ( body, & prefix, context, shape) {
401
+ Some ( single_line_body_str) if !single_line_body_str. contains ( '\n' ) => {
402
+ single_line_body_str
408
403
}
404
+ _ => body_str,
409
405
}
410
- _ => body_str,
411
406
}
412
- } ,
413
- ) ;
407
+ _ => body_str,
408
+ }
409
+ } ) ;
414
410
}
415
411
416
412
// When overflowing the closure which consists of a single control flow expression,
0 commit comments