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

Function optional_or_optional

cel/src/functions.rs:252–261  ·  view source on GitHub ↗
(This(this): This<Value>, other: Value)

Source from the content-addressed store, hash-verified

250}
251
252pub fn optional_or_optional(This(this): This<Value>, other: Value) -> Result<Value> {
253 let this_opt: &OptionalValue = (&this).try_into()?;
254 match this_opt.value() {
255 Some(_) => Ok(this),
256 None => {
257 let _: &OptionalValue = (&other).try_into()?;
258 Ok(other)
259 }
260 }
261}
262
263pub fn optional_or_value(This(this): This<Value>, other: Value) -> Result<Value> {
264 let this_opt: &OptionalValue = (&this).try_into()?;

Callers

nothing calls this directly

Calls 2

try_intoMethod · 0.80
valueMethod · 0.80

Tested by

no test coverage detected