@@ -4336,21 +4336,20 @@ fn gen_do_while_stmt<'a>(node: &'a DoWhileStmt, context: &mut Context<'a>) -> Pr
4336
4336
// the braces are technically optional on do while statements
4337
4337
let mut items = PrintItems :: new ( ) ;
4338
4338
items. push_str ( "do" ) ;
4339
- let open_brace_token = if let Stmt :: Block ( _) = node. body {
4340
- context. token_finder . get_first_open_brace_token_within ( node)
4341
- } else {
4342
- None
4343
- } ;
4344
4339
items. extend ( gen_brace_separator (
4345
4340
GenBraceSeparatorOptions {
4346
4341
brace_position : context. config . do_while_statement_brace_position ,
4347
- open_brace_token,
4342
+ open_brace_token : if let Stmt :: Block ( _) = node. body {
4343
+ context. token_finder . get_first_open_brace_token_within ( node)
4344
+ } else {
4345
+ None
4346
+ } ,
4348
4347
start_header_lsil : None ,
4349
4348
} ,
4350
4349
context,
4351
4350
) ) ;
4352
4351
items. extend ( gen_node ( node. body . into ( ) , context) ) ;
4353
- if open_brace_token . is_some ( ) {
4352
+ if context . config . semi_colons . is_true ( ) || matches ! ( node . body , Stmt :: Block ( _ ) ) {
4354
4353
items. extend ( gen_control_flow_separator (
4355
4354
context. config . do_while_statement_next_control_flow_position ,
4356
4355
& node. body . range ( ) ,
@@ -4360,7 +4359,7 @@ fn gen_do_while_stmt<'a>(node: &'a DoWhileStmt, context: &mut Context<'a>) -> Pr
4360
4359
context,
4361
4360
) ) ;
4362
4361
} else {
4363
- // if the body is not a block, then we just always
4362
+ // if ASI and the body is not a block, then we just always
4364
4363
// put this on the next line for simplicity for now
4365
4364
items. push_signal ( Signal :: NewLine ) ;
4366
4365
}
0 commit comments