Always put the | in a has clause on a new line

This commit is contained in:
Richard Feldman 2022-09-11 20:19:09 -04:00
parent 8e6abc8079
commit fd2ef1a3ce
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -324,7 +324,13 @@ impl<'a> Formattable for TypeAnnotation<'a> {
Where(annot, has_clauses) => {
annot.format_with_options(buf, parens, newlines, indent);
buf.spaces(1);
// Always put the `|` on the next line, indented.
let indent = indent + INDENT;
buf.newline();
buf.indent(indent);
for (i, has) in has_clauses.iter().enumerate() {
buf.push(if i == 0 { '|' } else { ',' });
buf.spaces(1);