ensure

Macro ensure 

Source
macro_rules! ensure {
    ($cond:expr, $e:expr $(,)?) => { ... };
}
Expand description

Return with an error if a condition is not met.

Simplifies the pattern of checking for a condition and returning with an error.