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