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

Method add_op

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

Source from the content-addressed store, hash-verified

48 }
49
50 fn add_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
51 if let Some(other_int) = other.as_any().downcast_ref::<FloatValue>() {
52 let value = self.value + other_int.value;
53 return Ok(Box::new(FloatValue { value }));
54 }
55 Err("Unexpected value to perform `+` with".to_string())
56 }
57
58 fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
59 if let Some(other_int) = other.as_any().downcast_ref::<FloatValue>() {

Callers

nothing calls this directly

Calls 1

as_anyMethod · 0.45

Tested by

no test coverage detected