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

Method cast_op

crates/gitql-core/src/values/boolean.rs:290–298  ·  view source on GitHub ↗
(&self, target_type: &Box<dyn DataType>)

Source from the content-addressed store, hash-verified

288 }
289
290 fn cast_op(&self, target_type: &Box<dyn DataType>) -> Result<Box<dyn Value>, String> {
291 // Cast to Int Type
292 if target_type.is_int() {
293 let value = if self.value { 1 } else { 0 };
294 return Ok(Box::new(IntValue { value }));
295 }
296
297 Err("Unexpected value to perform `CAST` with".to_string())
298 }
299}

Callers

nothing calls this directly

Calls 1

is_intMethod · 0.45

Tested by

no test coverage detected