macro_rules! ax_err { ($err: ident) => { ... }; ($err: ident, $msg: expr) => { ... }; }
Expand description
Convenience method to construct an Err(AxError)
type while printing a
warning message.
Examples
// Also print "[AxError::AlreadyExists]" if the `log` crate is enabled.
assert_eq!(
ax_err!(AlreadyExists),
AxResult::<()>::Err(AxError::AlreadyExists),
);
// Also print "[AxError::BadAddress] the address is 0!" if the `log` crate is enabled.
assert_eq!(
ax_err!(BadAddress, "the address is 0!"),
AxResult::<()>::Err(AxError::BadAddress),
);