MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / sub

Method sub

crates/gitql-ast/src/interval.rs:32–41  ·  view source on GitHub ↗
(&self, other: &Interval)

Source from the content-addressed store, hash-verified

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();

Callers 1

sub_opMethod · 0.80

Calls 2

Tested by

no test coverage detected