macro_rules! bail {
($e:expr) => { ... };
}Expand description
Return early with an error.
Modelled after anyhow::bail.
ยงExample
use homestar_invocation::{bail, Error, Unit};
fn has_permission(user: usize, resource: usize) -> bool {
true
}
if !has_permission(user, resource) {
bail!(Error::Unknown);
}