Disallow putting a body with attributes on the same line

This commit is contained in:
topecongiro 2019-04-14 20:13:54 +09:00
parent 3d80678e24
commit b57e0e2279

View file

@ -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 = {