(&self, other: &Box<dyn Value>)
| 60 | } |
| 61 | |
| 62 | fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 63 | if let Some(days) = other.as_int() { |
| 64 | let days_to_timestamp = days * 24 * 60 * 60; |
| 65 | let timestamp = self.timestamp - days_to_timestamp; |
| 66 | return Ok(Box::new(DateValue::new(timestamp))); |
| 67 | } |
| 68 | Err("Unexpected type to perform `-` with".to_string()) |
| 69 | } |
| 70 | |
| 71 | fn eq_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 72 | if let Some(other_text) = other.as_any().downcast_ref::<DateValue>() { |
no test coverage detected