Skip to content

Commit

Permalink
Mark Report as #[must_use] (#73)
Browse files Browse the repository at this point in the history
Not using the error type after construction is a common mistake. This can also easily happen with the provided macros, when using `eyre!` instead of `eyre::bail!`. By marking the type as `#[must_use]`, the compiler warns us in such cases.
  • Loading branch information
phil-opp committed Mar 30, 2022
1 parent 769e26e commit 4f96615
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ pub use WrapErr as Context;
///
/// [`EyreHandler`]: trait.EyreHandler.html
/// [`hook`]: fn.set_hook.html
#[must_use]
pub struct Report {
inner: ManuallyDrop<Box<ErrorImpl<()>>>,
}
Expand Down

0 comments on commit 4f96615

Please sign in to comment.