Function
optional_of_non_zero_value
(ftx: &FunctionContext, value: Value)
Source from the content-addressed store, hash-verified
| 229 | } |
| 230 | |
| 231 | pub fn optional_of_non_zero_value(ftx: &FunctionContext, value: Value) -> Result<Value> { |
| 232 | if ftx.this.is_some() { |
| 233 | return Err(ftx.error("unsupported function")); |
| 234 | } |
| 235 | if value.is_zero() { |
| 236 | Ok(Value::Opaque(Arc::new(OptionalValue::none()))) |
| 237 | } else { |
| 238 | Ok(Value::Opaque(Arc::new(OptionalValue::of(value)))) |
| 239 | } |
| 240 | } |
| 241 | pub fn optional_value(This(this): This<Value>) -> Result<Value> { |
| 242 | <&OptionalValue>::try_from(&this)? |
| 243 | .value() |
Callers
nothing calls this directly
Tested by
no test coverage detected