MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / try_bool

Function try_bool

cel/src/objects.rs:1555–1563  ·  view source on GitHub ↗
(val: Result<Cow<dyn Val>, ExecutionError>)

Source from the content-addressed store, hash-verified

1553}
1554
1555fn try_bool(val: Result<Cow<dyn Val>, ExecutionError>) -> Result<bool, ExecutionError> {
1556 match val {
1557 Ok(val) => val
1558 .downcast_ref::<CelBool>()
1559 .map(|b| *b.inner())
1560 .ok_or(ExecutionError::NoSuchOverload),
1561 Err(err) => Result::Err(err),
1562 }
1563}
1564
1565impl ops::Add<Value> for Value {
1566 type Output = ResolveResult;

Callers 1

resolve_valMethod · 0.85

Calls 2

mapMethod · 0.80
innerMethod · 0.45

Tested by

no test coverage detected