@@ -116,7 +116,7 @@ pub fn format_expr(
116116 rw
117117 } else {
118118 let prefix = block_prefix ( context, block, shape) ?;
119- rewrite_block_with_visitor ( context, & prefix, block, shape, false )
119+ rewrite_block_with_visitor ( context, & prefix, block, shape, true )
120120 }
121121 }
122122 ExprType :: SubExpression => block. rewrite ( context, shape) ,
@@ -603,7 +603,7 @@ pub fn rewrite_block_with_visitor(
603603 prefix : & str ,
604604 block : & ast:: Block ,
605605 shape : Shape ,
606- is_dummy : bool ,
606+ has_braces : bool ,
607607) -> Option < String > {
608608 if let rw @ Some ( _) = rewrite_empty_block ( context, block, shape) {
609609 return rw;
@@ -621,7 +621,7 @@ pub fn rewrite_block_with_visitor(
621621 ast:: BlockCheckMode :: Default => visitor. last_pos = block. span . lo ( ) ,
622622 }
623623
624- visitor. visit_block ( block, None , is_dummy ) ;
624+ visitor. visit_block ( block, None , has_braces ) ;
625625 Some ( format ! ( "{}{}" , prefix, visitor. buffer) )
626626}
627627
@@ -636,7 +636,7 @@ impl Rewrite for ast::Block {
636636 let prefix = block_prefix ( context, self , shape) ?;
637637 let shape = shape. offset_left ( last_line_width ( & prefix) ) ?;
638638
639- let result = rewrite_block_with_visitor ( context, & prefix, self , shape, false ) ;
639+ let result = rewrite_block_with_visitor ( context, & prefix, self , shape, true ) ;
640640 if let Some ( ref result_str) = result {
641641 if result_str. lines ( ) . count ( ) <= 3 {
642642 if let rw @ Some ( _) = rewrite_single_line_block ( context, & prefix, self , shape) {
@@ -1067,7 +1067,7 @@ impl<'a> Rewrite for ControlFlow<'a> {
10671067 let mut block_context = context. clone ( ) ;
10681068 block_context. is_if_else_block = self . else_block . is_some ( ) ;
10691069 let block_str =
1070- rewrite_block_with_visitor ( & block_context, "" , self . block , block_shape, false ) ?;
1070+ rewrite_block_with_visitor ( & block_context, "" , self . block , block_shape, true ) ?;
10711071
10721072 let mut result = format ! ( "{}{}" , cond_str, block_str) ;
10731073
0 commit comments