Macro kompact::let_irrefutable
source · macro_rules! let_irrefutable { ($name:ident, $pattern:pat = $expression:expr) => { ... }; }
Expand description
A macro that provides a shorthand for an irrefutable let binding, that the compiler cannot determine on its own
This is equivalent to the following code:
let name = if let Pattern(name) = expression { name } else { unreachable!(); };