(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
)
| 200 | } |
| 201 | |
| 202 | fn group_lt_op( |
| 203 | &self, |
| 204 | other: &Box<dyn Value>, |
| 205 | group_op: &GroupComparisonOperator, |
| 206 | ) -> Result<Box<dyn Value>, String> { |
| 207 | if other.is_array_of(|element_type| element_type.is_date_time()) { |
| 208 | let elements = &other.as_array().unwrap(); |
| 209 | let mut matches_count = 0; |
| 210 | for element in elements.iter() { |
| 211 | if self.value < element.as_date_time().unwrap() { |
| 212 | matches_count += 1; |
| 213 | if GroupComparisonOperator::Any.eq(group_op) { |
| 214 | break; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | let result = match group_op { |
| 220 | GroupComparisonOperator::All => matches_count == elements.len(), |
| 221 | GroupComparisonOperator::Any => matches_count > 0, |
| 222 | }; |
| 223 | |
| 224 | return Ok(Box::new(BoolValue::new(result))); |
| 225 | } |
| 226 | Err("Unexpected type to perform `<` with".to_string()) |
| 227 | } |
| 228 | |
| 229 | fn lte_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 230 | if let Some(other_text) = other.as_any().downcast_ref::<DateTimeValue>() { |
nothing calls this directly
no test coverage detected