| 47 | } |
| 48 | |
| 49 | fn eq_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 50 | if let Some(other_interval) = other.as_any().downcast_ref::<IntervalValue>() { |
| 51 | let is_equals = self.interval == other_interval.interval; |
| 52 | return Ok(Box::new(BoolValue::new(is_equals))); |
| 53 | } |
| 54 | Err("Unexpected type to perform `=` with".to_string()) |
| 55 | } |
| 56 | |
| 57 | fn bang_eq_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 58 | if let Some(other_interval) = other.as_any().downcast_ref::<IntervalValue>() { |