Avoid patterns that may look like implements clauses without parens

This commit is contained in:
Joshua Warner 2024-12-14 13:04:25 -08:00
parent 8f2a10d52d
commit 24dd11262e
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
2 changed files with 8 additions and 1 deletions

View file

@ -568,7 +568,13 @@ impl<'a> Formattable for TypeHeader<'a> {
last_after = var.after;
last_multiline = var.item.is_multiline();
let need_parens = matches!(var.item, Pattern::Apply(..));
let need_parens = matches!(
var.item,
Pattern::Apply(..)
| Pattern::Identifier {
ident: "implements"
}
);
if need_parens {
buf.indent(vars_indent);