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

Method mul

crates/gitql-ast/src/interval.rs:43–52  ·  view source on GitHub ↗
(&self, other: i64)

Source from the content-addressed store, hash-verified

41 }
42
43 pub fn mul(&self, other: i64) -> Result<Interval, String> {
44 let mut result = self.clone();
45 result.years = interval_value_or_error_i64(result.years * other)?;
46 result.months = interval_value_or_error_i64(result.months * other)?;
47 result.days = interval_value_or_error_i64(result.days * other)?;
48 result.hours = interval_value_or_error_i64(result.hours * other)?;
49 result.minutes = interval_value_or_error_i64(result.minutes * other)?;
50 result.seconds = interval_value_or_error_f64(result.seconds.mul(other as f64))?;
51 Ok(result)
52 }
53
54 pub fn div(&self, other: i64) -> Result<Interval, String> {
55 let mut result = self.clone();

Callers 2

mul_opMethod · 0.80
parse_interval_literalFunction · 0.80

Calls 2

Tested by

no test coverage detected