Fix as pattern formatting inside apply

This commit is contained in:
Joshua Warner 2024-12-10 17:57:28 -08:00
parent f8b0be725c
commit 04612fb2cb
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 48 additions and 1 deletions

View file

@ -395,7 +395,7 @@ fn fmt_pattern_only(
}
Pattern::As(pattern, pattern_as) => {
let needs_parens = parens == Parens::InAsPattern;
let needs_parens = parens == Parens::InAsPattern || parens == Parens::InApply;
if needs_parens {
buf.indent(indent);