We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f84c399 commit c2ecb30Copy full SHA for c2ecb30
rustfmt-core/rustfmt-lib/src/matches.rs
@@ -299,7 +299,11 @@ fn flatten_arm_body<'a>(
299
if let Some(ref block) = block_can_be_flattened(context, body) {
300
if let ast::StmtKind::Expr(ref expr) = block.stmts[0].kind {
301
if let ast::ExprKind::Block(..) = expr.kind {
302
- flatten_arm_body(context, expr, None)
+ if expr.attrs.is_empty() {
303
+ flatten_arm_body(context, expr, None)
304
+ } else {
305
+ (true, body)
306
+ }
307
} else {
308
let cond_becomes_muti_line = opt_shape
309
.and_then(|shape| rewrite_cond(context, expr, shape))
0 commit comments