macro_rules! unwrap_or {
($opt:expr, $default:expr, $select:path) => { ... };
}Expand description
Helper macro for providing behavior like the CtOption::unwrap_or combinator that works in
const fn contexts.
Requires a provided selector function $select to perform constant-time selection which takes
two T values by reference along with a Choice, returning the first T for
Choice::FALSE, and the second for Choice::TRUE, e.g.:
ⓘ
const fn ct_select(a: &T, b: &T, condition: Choice) -> T