Skip to content
Myr

Link from `bail!` and `ensure!` to anyhow::Error

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 5ec6713 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/macros.rs+2 added-2 removed
1 unmodified line
2///3/// This macro is equivalent to `return Err(anyhow!($args...))`.4///5/// The surrounding function's or closure's return value is required to be6/// `Result<_, anyhow::Error>`.6/// `Result<_,`[`anyhow::Error`][crate::Error]`>`.7///8/// # Example9///10/// ```
56 unmodified lines
67///68/// This macro is equivalent to `if !$cond { return Err(anyhow!($args...)); }`.69///70/// The surrounding function's or closure's return value is required to be71/// `Result<_, anyhow::Error>`.71/// `Result<_,`[`anyhow::Error`][crate::Error]`>`.72///73/// Analogously to `assert!`, `ensure!` takes a condition and exits the function74/// if the condition fails. Unlike `assert!`, `ensure!` returns an `Error`75/// rather than panicking.
100 unmodified lines