Use newline in places where it should obviously be used

This commit is contained in:
Joshua Warner 2021-11-30 06:56:58 -08:00
parent 2464cb107c
commit 8ab7b121eb

View file

@ -591,8 +591,7 @@ fn fmt_when<'a>(
);
for when_pattern in rest {
if is_multiline {
buf.push_str("\n");
add_spaces(buf, indent + INDENT);
newline(buf, indent + INDENT);
buf.push_str("| ");
} else {
buf.push_str(" | ");
@ -605,9 +604,9 @@ fn fmt_when<'a>(
guard_expr.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, indent + INDENT);
}
buf.push_str(" ->\n");
buf.push_str(" ->");
newline(buf, indent + INDENT * 2);
add_spaces(buf, indent + (INDENT * 2));
match expr.value {
Expr::SpaceBefore(nested, spaces) => {
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent + (INDENT * 2));