formatter: support removing blank lines between all when branches in when expressions

This commit is contained in:
Sean Hagstrom 2022-05-19 09:04:27 +01:00
parent 802422e6f4
commit 08777434b6
No known key found for this signature in database
GPG key ID: AA9814E95B301A5C
31 changed files with 1 additions and 372 deletions

View file

@ -636,9 +636,6 @@ fn fmt_when<'a, 'buf>(
indent: u16,
) {
let is_multiline_condition = loc_condition.is_multiline();
let has_multiline_branches = branches
.iter()
.any(|branch| is_when_patterns_multiline(branch) || branch.value.is_multiline());
buf.indent(indent);
buf.push_str(
"\
@ -744,9 +741,6 @@ fn fmt_when<'a, 'buf>(
if it.peek().is_some() {
buf.newline();
if has_multiline_branches {
buf.newline();
}
}
}
}