Skip to main content

as_expr_or_panic

Macro as_expr_or_panic 

Source
macro_rules! as_expr_or_panic {
    ($opt:expr, $error_msg:expr) => { ... };
}
Expand description

Macro to unwrap an Option to Expr for functions returning primitives. Returns the expression on success, or panics with the error message on failure.

This macro is designed for use in functions that return primitive types like f64 where error handling must be done via panic.

§Usage

let expr = as_expr_or_panic!(result_value, "Argument not expression");

§Arguments

  • $opt: The EvaluateResultValue to unwrap
  • $error_msg: Error message string literal