Switch the get_loop_elements implementation to only return populated arrays when its an array-like object.
This commit is contained in:
@@ -545,11 +545,7 @@ mod tests {
|
||||
|
||||
impl Loopable for String {
|
||||
fn get_loop_elements(&self) -> Vec<&dyn ContextElement> {
|
||||
if self.is_empty() {
|
||||
Vec::new()
|
||||
} else {
|
||||
vec![self]
|
||||
}
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,7 +586,7 @@ mod tests {
|
||||
|
||||
impl Loopable for u64 {
|
||||
fn get_loop_elements(&self) -> Vec<&dyn ContextElement> {
|
||||
vec![self]
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -640,7 +636,7 @@ mod tests {
|
||||
|
||||
impl<I: 'static + ContextElement + Clone> Loopable for HashMap<String, I> {
|
||||
fn get_loop_elements(&self) -> Vec<&dyn ContextElement> {
|
||||
vec![self]
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user