fix formatter crash

This commit is contained in:
Eli Dowling 2024-02-11 12:34:14 +10:00 committed by faldor20
parent b9d5979c1f
commit c89c8c3e95
No known key found for this signature in database
GPG key ID: F2216079B890CD57

View file

@ -42,7 +42,8 @@ impl<'a> Formattable for Pattern<'a> {
// Theory: a pattern should only be multiline when it contains a comment
match self {
Pattern::SpaceBefore(_, spaces) | Pattern::SpaceAfter(_, spaces) => {
debug_assert!(!spaces.is_empty());
//TODO: This isn't always true, should it be?
// debug_assert!(!spaces.is_empty());
spaces.iter().any(|s| s.is_comment())
}