Skip to content

Commit b57e0e2

Browse files
committed
Disallow putting a body with attributes on the same line
1 parent 3d80678 commit b57e0e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/matches.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ fn rewrite_match_body(
364364
shape.indent
365365
};
366366

367-
let forbid_same_line = has_guard && pats_str.contains('\n') && !is_empty_block;
367+
let forbid_same_line =
368+
(has_guard && pats_str.contains('\n') && !is_empty_block) || !body.attrs.is_empty();
368369

369370
// Look for comments between `=>` and the start of the body.
370371
let arrow_comment = {

0 commit comments

Comments
 (0)