mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Use a pattern match over ==
This commit is contained in:
parent
267bae5dec
commit
ca0b40cd9d
1 changed files with 7 additions and 6 deletions
|
@ -577,12 +577,13 @@ fn format_spaces<'a, 'buf>(
|
||||||
newlines: Newlines,
|
newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
) {
|
) {
|
||||||
let format_newlines = newlines == Newlines::Yes;
|
match newlines {
|
||||||
|
Newlines::Yes => {
|
||||||
if format_newlines {
|
fmt_spaces(buf, spaces.iter(), indent);
|
||||||
fmt_spaces(buf, spaces.iter(), indent);
|
}
|
||||||
} else {
|
Newlines::No => {
|
||||||
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
|
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue