Skip to main content

cli_ensure

Macro cli_ensure 

Source
macro_rules! cli_ensure {
    ($cond:expr, $msg:literal $(,)?) => { ... };
    ($cond:expr, $err:expr $(,)?) => { ... };
    ($cond:expr, $fmt:expr, $($arg:tt)*) => { ... };
}
Expand description

Return early with an error if a condition is not satisfied.

This macro is equivalent to if !$cond { return Err(From::from($err)); }.