Use a pattern match over ==

This commit is contained in:
Richard Feldman 2022-07-06 15:07:54 -04:00
parent 267bae5dec
commit ca0b40cd9d
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -577,12 +577,13 @@ fn format_spaces<'a, 'buf>(
newlines: Newlines,
indent: u16,
) {
let format_newlines = newlines == Newlines::Yes;
if format_newlines {
fmt_spaces(buf, spaces.iter(), indent);
} else {
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
match newlines {
Newlines::Yes => {
fmt_spaces(buf, spaces.iter(), indent);
}
Newlines::No => {
fmt_comments_only(buf, spaces.iter(), NewlineAt::Bottom, indent);
}
}
}