Fix unstable formatting with nested applies

This commit is contained in:
Anthony Bullard 2025-01-01 09:10:27 -06:00
parent 2bb3b84ce7
commit 8690a02d8f
No known key found for this signature in database

View file

@ -701,8 +701,16 @@ fn fmt_apply(
if !expr.before.is_empty() {
format_spaces(buf, expr.before, Newlines::Yes, indent);
}
expr.item
.format_with_options(buf, Parens::InApply, Newlines::Yes, indent);
expr.item.format_with_options(
buf,
if use_commas_and_parens {
Parens::NotNeeded
} else {
Parens::InApply
},
Newlines::Yes,
indent,
);
if use_commas_and_parens {
buf.push('(');