-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: #408 Implement `WrapError` for `Option<T>`. This is inline with `anyhow` that also implements `Context` for `Option<T>`. The implementation requires us to introduce a `DisplayError` internal only type, that creates an error from a type that only implements `Display` (`Report::from_adhoc` requires the type to also implement `Debug`, but `WrapError` only requires it to implement `Display`). For this I copied `MessageError` and adapted it to implement `Debug` using the underlying type's `Display` impl. This is a bit of a hack, but anyhow does [something similar][1]. [1]: https://docs.rs/anyhow/latest/src/anyhow/wrapper.rs.html#34
- Loading branch information
1 parent
465e6b6
commit 7fae60f
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters