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

Method sub_op

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

Source from the content-addressed store, hash-verified

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>() {
107 let interval = self.interval.sub(&other_interval.interval)?;
108 return Ok(Box::new(IntervalValue::new(interval)));
109 }
110 Err("Unexpected type to perform `-` with".to_string())
111 }
112
113 fn mul_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
114 if let Some(value) = other.as_int() {

Callers

nothing calls this directly

Calls 2

subMethod · 0.80
as_anyMethod · 0.45

Tested by

no test coverage detected