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, 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);
}
} }
} }