Switched over to using operators instead of compare in the renderer.

This commit is contained in:
Tom Alexander 2020-05-16 23:10:04 -04:00
parent 596611c03a
commit d77ab7401c
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -343,19 +343,19 @@ impl<'a> DustRenderer<'a> {
) )
} }
(Ok(left_side_unwrapped), Ok(right_side_unwrapped)) => { (Ok(left_side_unwrapped), Ok(right_side_unwrapped)) => {
return match left_side_unwrapped.partial_cmp(&right_side_unwrapped) { if left_side_unwrapped >= right_side_unwrapped {
Some(Ordering::Greater) | Some(Ordering::Equal) | None => self return self.render_maybe_body(
.render_maybe_body(
&parameterized_block.contents, &parameterized_block.contents,
breadcrumbs, breadcrumbs,
blocks, blocks,
), );
Some(Ordering::Less) => self.render_maybe_body( } else {
return self.render_maybe_body(
&parameterized_block.else_contents, &parameterized_block.else_contents,
breadcrumbs, breadcrumbs,
blocks, blocks,
), );
}; }
} }
} }
} }
@ -415,19 +415,19 @@ impl<'a> DustRenderer<'a> {
) )
} }
(Ok(left_side_unwrapped), Ok(right_side_unwrapped)) => { (Ok(left_side_unwrapped), Ok(right_side_unwrapped)) => {
return match left_side_unwrapped.partial_cmp(&right_side_unwrapped) { if left_side_unwrapped <= right_side_unwrapped {
Some(Ordering::Less) | Some(Ordering::Equal) | None => self return self.render_maybe_body(
.render_maybe_body(
&parameterized_block.contents, &parameterized_block.contents,
breadcrumbs, breadcrumbs,
blocks, blocks,
), );
Some(Ordering::Greater) => self.render_maybe_body( } else {
return self.render_maybe_body(
&parameterized_block.else_contents, &parameterized_block.else_contents,
breadcrumbs, breadcrumbs,
blocks, blocks,
), );
}; }
} }
} }
} }