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

Method sub_op

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

Source from the content-addressed store, hash-verified

60 }
61
62 fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
63 if let Some(other_int) = other.as_any().downcast_ref::<IntValue>() {
64 let value = self.value - other_int.value;
65 return Ok(Box::new(IntValue::new(value)));
66 }
67 Err("Unexpected type to perform `-` with".to_string())
68 }
69
70 fn mul_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
71 if let Some(other_int) = other.as_any().downcast_ref::<IntValue>() {

Callers

nothing calls this directly

Calls 1

as_anyMethod · 0.45

Tested by

no test coverage detected