mirror of
https://github.com/eyre-rs/eyre.git
synced 2025-09-28 13:31:29 +00:00
Rename throw macro to bail
This commit is contained in:
parent
61cf951a14
commit
27b8f244d1
@ -8,11 +8,11 @@ pub use crate::as_error::AsError;
|
||||
pub use crate::context::Context;
|
||||
pub use crate::exception::{Errors, Exception};
|
||||
|
||||
/// Throw an error.
|
||||
/// Return early with an error.
|
||||
///
|
||||
/// This macro is equivalent to `Err($err)?`.
|
||||
/// This macro is equivalent to `return Err(From::from($err))`.
|
||||
#[macro_export]
|
||||
macro_rules! throw {
|
||||
macro_rules! bail {
|
||||
($err:expr) => {
|
||||
return std::result::Result::Err(std::convert::From::from($err));
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user