Don't indent multiple patterns

This commit is contained in:
Richard Feldman 2022-07-13 21:50:30 -04:00
parent f066ee12dc
commit 28e0a9e382
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

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