Had to manually interpret the partial_cmp
output instead of using the built-in operators since gte confusingly returns true for mismatched values.
This commit is contained in:
parent
62cd73f9c9
commit
496a5e0ac7
@ -14,7 +14,7 @@ use crate::renderer::inline_partial_tree::extract_inline_partials;
|
||||
use crate::renderer::inline_partial_tree::InlinePartialTreeElement;
|
||||
use crate::renderer::parameters_context::ParametersContext;
|
||||
use crate::renderer::walking::walk_path;
|
||||
use std::collections::HashMap;
|
||||
use std::{cmp::Ordering, collections::HashMap};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct CompiledTemplate<'a> {
|
||||
@ -337,25 +337,25 @@ impl<'a> DustRenderer<'a> {
|
||||
match (left_side, right_side) {
|
||||
(Err(_), _) | (_, Err(_)) => {
|
||||
return self.render_maybe_body(
|
||||
¶meterized_block.contents,
|
||||
¶meterized_block.else_contents,
|
||||
breadcrumbs,
|
||||
blocks,
|
||||
)
|
||||
}
|
||||
(Ok(left_side_unwrapped), Ok(right_side_unwrapped)) => {
|
||||
if left_side_unwrapped >= right_side_unwrapped {
|
||||
return self.render_maybe_body(
|
||||
¶meterized_block.contents,
|
||||
breadcrumbs,
|
||||
blocks,
|
||||
);
|
||||
} else {
|
||||
return self.render_maybe_body(
|
||||
return match left_side_unwrapped.partial_cmp(&right_side_unwrapped) {
|
||||
Some(Ordering::Greater) | Some(Ordering::Equal) | None => self
|
||||
.render_maybe_body(
|
||||
¶meterized_block.contents,
|
||||
breadcrumbs,
|
||||
blocks,
|
||||
),
|
||||
Some(Ordering::Less) => self.render_maybe_body(
|
||||
¶meterized_block.else_contents,
|
||||
breadcrumbs,
|
||||
blocks,
|
||||
);
|
||||
}
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user