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

Method add_op

crates/gitql-core/src/values/interval.rs:97–103  ·  view source on GitHub ↗
(&self, other: &Box<dyn Value>)

Source from the content-addressed store, hash-verified

95 }
96
97 fn add_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
98 if let Some(other_interval) = other.as_any().downcast_ref::<IntervalValue>() {
99 let interval = self.interval.add(&other_interval.interval)?;
100 return Ok(Box::new(IntervalValue::new(interval)));
101 }
102 Err("Unexpected type to perform `+` with".to_string())
103 }
104
105 fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
106 if let Some(other_interval) = other.as_any().downcast_ref::<IntervalValue>() {

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
as_anyMethod · 0.45

Tested by

no test coverage detected