mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
stylistic improvements
This commit is contained in:
parent
2c5b085ed5
commit
1efd7615f0
6 changed files with 90 additions and 45 deletions
|
@ -41,8 +41,12 @@ impl<'a> Formattable for Pattern<'a> {
|
|||
fn is_multiline(&self) -> bool {
|
||||
// Theory: a pattern should only be multiline when it contains a comment
|
||||
match self {
|
||||
Pattern::SpaceBefore(a, spaces) | Pattern::SpaceAfter(a, spaces) => {
|
||||
debug_assert!(!spaces.is_empty(), "spaces is empty in pattern {:#?}", a);
|
||||
Pattern::SpaceBefore(pattern, spaces) | Pattern::SpaceAfter(pattern, spaces) => {
|
||||
debug_assert!(
|
||||
!spaces.is_empty(),
|
||||
"spaces is empty in pattern {:#?}",
|
||||
pattern
|
||||
);
|
||||
|
||||
spaces.iter().any(|s| s.is_comment())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue