Disallow putting a body with attributes on the same line
This commit is contained in:
parent
3d80678e24
commit
b57e0e2279
1 changed files with 2 additions and 1 deletions
|
@ -364,7 +364,8 @@ fn rewrite_match_body(
|
|||
shape.indent
|
||||
};
|
||||
|
||||
let forbid_same_line = has_guard && pats_str.contains('\n') && !is_empty_block;
|
||||
let forbid_same_line =
|
||||
(has_guard && pats_str.contains('\n') && !is_empty_block) || !body.attrs.is_empty();
|
||||
|
||||
// Look for comments between `=>` and the start of the body.
|
||||
let arrow_comment = {
|
||||
|
|
Loading…
Reference in a new issue