Don't print extra newline in multiline | patterns

This commit is contained in:
Richard Feldman 2022-07-03 22:43:21 -04:00
parent d1ba89f97f
commit cab096b4e1
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
2 changed files with 9 additions and 1 deletions

View file

@ -723,7 +723,7 @@ fn fmt_when<'a, 'buf>(
}
} else {
if is_multiline_patterns {
buf.newline();
buf.ensure_ends_in_newline();
// Indent an extra level for the `|`;
// otherwise it'll be at the start of the line,
// and will be incorrectly parsed as a pattern