(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
)
| 95 | } |
| 96 | |
| 97 | fn group_bang_eq_op( |
| 98 | &self, |
| 99 | other: &Box<dyn Value>, |
| 100 | group_op: &GroupComparisonOperator, |
| 101 | ) -> Result<Box<dyn Value>, String> { |
| 102 | if other.is_array_of(|element_type| element_type.is_date_time()) { |
| 103 | let elements = &other.as_array().unwrap(); |
| 104 | let mut matches_count = 0; |
| 105 | for element in elements.iter() { |
| 106 | if self.value != element.as_date_time().unwrap() { |
| 107 | matches_count += 1; |
| 108 | if GroupComparisonOperator::Any.eq(group_op) { |
| 109 | break; |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | let result = match group_op { |
| 115 | GroupComparisonOperator::All => matches_count == elements.len(), |
| 116 | GroupComparisonOperator::Any => matches_count > 0, |
| 117 | }; |
| 118 | |
| 119 | return Ok(Box::new(BoolValue::new(result))); |
| 120 | } |
| 121 | Err("Unexpected type to perform `!=` with".to_string()) |
| 122 | } |
| 123 | |
| 124 | fn gt_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 125 | if let Some(other_text) = other.as_any().downcast_ref::<DateTimeValue>() { |
nothing calls this directly
no test coverage detected