Don't do empty record destructure elision when the body is itself Defs

This commit is contained in:
Joshua Warner 2024-12-02 17:26:32 -08:00
parent cabe67f88d
commit 89a64fed74
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 83 additions and 0 deletions

View file

@ -1039,6 +1039,7 @@ pub fn fmt_body<'a>(
&& collection.is_empty()
&& pattern_extracted.before.iter().all(|s| s.is_newline())
&& pattern_extracted.after.iter().all(|s| s.is_newline())
&& !matches!(body.extract_spaces().item, Expr::Defs(..))
} else {
false
};