(&self, other: &Interval)
| 30 | } |
| 31 | |
| 32 | pub fn sub(&self, other: &Interval) -> Result<Interval, String> { |
| 33 | let mut result = self.clone(); |
| 34 | result.years = interval_value_or_error_i64(result.years - other.years)?; |
| 35 | result.months = interval_value_or_error_i64(result.months - other.months)?; |
| 36 | result.days = interval_value_or_error_i64(result.days - other.days)?; |
| 37 | result.hours = interval_value_or_error_i64(result.hours - other.hours)?; |
| 38 | result.minutes = interval_value_or_error_i64(result.minutes - other.minutes)?; |
| 39 | result.seconds = interval_value_or_error_f64(result.seconds - other.seconds)?; |
| 40 | Ok(result) |
| 41 | } |
| 42 | |
| 43 | pub fn mul(&self, other: i64) -> Result<Interval, String> { |
| 44 | let mut result = self.clone(); |
no test coverage detected