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

Method add_op

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

Source from the content-addressed store, hash-verified

52 }
53
54 fn add_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
55 if let Some(other_int) = other.as_any().downcast_ref::<IntValue>() {
56 let value = self.value + other_int.value;
57 return Ok(Box::new(IntValue::new(value)));
58 }
59 Err("Unexpected type to perform `+` with".to_string())
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>() {

Callers

nothing calls this directly

Calls 1

as_anyMethod · 0.45

Tested by

no test coverage detected