Switch the get_loop_elements implementation to only return populated arrays when its an array-like object.
This commit is contained in:
@@ -91,7 +91,7 @@ impl Loopable for ParametersContext {
|
||||
// TODO: Would this even ever be called? Won't matter, but I'd
|
||||
// like to know. Since it is injected 1 above the current
|
||||
// context, we wouldn't be able to access it with `{.}`.
|
||||
vec![self]
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,16 +158,7 @@ impl Renderable for OwnedLiteral {
|
||||
|
||||
impl Loopable for OwnedLiteral {
|
||||
fn get_loop_elements(&self) -> Vec<&dyn ContextElement> {
|
||||
match self {
|
||||
OwnedLiteral::LString(text) => {
|
||||
if text.is_empty() {
|
||||
Vec::new()
|
||||
} else {
|
||||
vec![self]
|
||||
}
|
||||
}
|
||||
OwnedLiteral::LPositiveInteger(num) => vec![self],
|
||||
}
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user