Fix formatting of if/else chains

This commit is contained in:
Joshua Warner 2021-11-26 11:03:45 -08:00
parent 2939780638
commit a7e4861956

View file

@ -672,9 +672,13 @@ fn fmt_if<'a>(
indent
};
for (loc_condition, loc_then) in branches.iter() {
for (i, (loc_condition, loc_then)) in branches.iter().enumerate() {
let is_multiline_condition = loc_condition.is_multiline();
if i > 0 {
buf.push_str("else ");
}
buf.push_str("if");
if is_multiline_condition {