(&self, other: &Box<dyn Value>)
| 51 | } |
| 52 | |
| 53 | fn add_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 54 | if let Some(days) = other.as_int() { |
| 55 | let days_to_timestamp = days * 24 * 60 * 60; |
| 56 | let timestamp = self.timestamp + days_to_timestamp; |
| 57 | return Ok(Box::new(DateValue::new(timestamp))); |
| 58 | } |
| 59 | Err("Unexpected type to perform `+` with".to_string()) |
| 60 | } |
| 61 | |
| 62 | fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 63 | if let Some(days) = other.as_int() { |
no test coverage detected