Skip to content

Commit

Permalink
Add note about recommended forward usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaBluejay committed Aug 15, 2023
1 parent 78d9d99 commit 8552a14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions impl/doc/error.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ A struct, enum, or enum variant can be annotated with `#[error(forward)]` to for
the `source()` implementation to the source field (inferred or explicitly annotated),
instead of returning the field itself.

In general this approach is only recommended if the error is intended to be fully
transparent, and forwards implementation of [`Display`](crate::Display) as well.

### What works in `no_std`?

If you want to use the `Error` derive on `no_std` environments, then you need to
Expand Down

0 comments on commit 8552a14

Please sign in to comment.