macro_rules! unwrap_opt_block { ($body:block $($arg:tt)*) => { ... }; }
Unwraps a block which returns an Option.
This is useful for running checked math expressions within a function which returns Result.
let result = unwrap_opt_block!({ let one: u64 = 1; let three: u64 = 3; let four = one.checked_add(three)?; four.checked_add(3) }); assert_eq!(result, 7);