diff --git a/crates/compiler/fmt/src/def.rs b/crates/compiler/fmt/src/def.rs index 15ec7b75a2..1198779263 100644 --- a/crates/compiler/fmt/src/def.rs +++ b/crates/compiler/fmt/src/def.rs @@ -348,6 +348,19 @@ pub fn fmt_body<'a, 'buf>( ); } } + Expr::Record { .. } | Expr::List { .. } | Expr::Closure(_, _) => { + if body.is_multiline() { + buf.spaces(1); + body.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, indent); + } else { + body.format_with_options( + buf, + Parens::NotNeeded, + Newlines::Yes, + indent + INDENT, + ); + } + } Expr::BinOps(_, _) => { // Binop chains always get a newline. Otherwise you can have things like: //