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

Method rem_op

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

Source from the content-addressed store, hash-verified

87 }
88
89 fn rem_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
90 if let Some(other_int) = other.as_any().downcast_ref::<IntValue>() {
91 let value = self.value % other_int.value;
92 return Ok(Box::new(IntValue::new(value)));
93 }
94 Err("Unexpected type to perform `%` with".to_string())
95 }
96
97 fn caret_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
98 if let Some(other_int) = other.as_any().downcast_ref::<IntValue>() {

Callers 1

evaluate_arithmeticFunction · 0.45

Calls 1

as_anyMethod · 0.45

Tested by

no test coverage detected