Switch the get_loop_elements implementation to only return populated arrays when its an array-like object.

This commit is contained in:
Tom Alexander
2020-05-24 16:27:13 -04:00
parent 59ee4f508f
commit 966499db76
5 changed files with 14 additions and 50 deletions

View File

@@ -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()
}
}