Switch the get_loop_elements implementation to only return populated arrays when its an array-like object.
This commit is contained in:
@@ -30,13 +30,12 @@ pub trait Renderable {
|
||||
pub trait Loopable {
|
||||
/// Return the elements for a Dust section
|
||||
///
|
||||
/// Sections in dust are accomplished with the {#path} syntax. A
|
||||
/// section has a truthiness check performed on it. If that
|
||||
/// truthiness check fails, then it will render the
|
||||
/// else-block. Otherwise if its a scalar value it will render
|
||||
/// once with the context being the element at that path. Finally,
|
||||
/// if its an array-like value then it will render n-times, once
|
||||
/// for each element of the array.
|
||||
/// Sections in dust are accomplished with the {#path} syntax. If
|
||||
/// its an array-like value then it will render n-times, once for
|
||||
/// each element of the array. If this is a scalar value, then
|
||||
/// return an empty array. Sections with scalar values will still
|
||||
/// be rendered (only once) if their truthiness check comes back
|
||||
/// true.
|
||||
fn get_loop_elements(&self) -> Vec<&dyn ContextElement>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user