Skip to content

Commit

Permalink
Add more traits
Browse files Browse the repository at this point in the history
  • Loading branch information
mexus committed Oct 21, 2024
1 parent 1e3c363 commit 3e397c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "display-error-chain"
version = "0.2.1"
version = "0.2.2"
authors = ["mexus <null@mexus.xyz>"]
edition = "2021"
description = "Formats a standard error and its sources"
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ pub use result_ext::ResultExt;
/// let chain: DisplayErrorChain<_> = (&CustomError::NoCause).into();
/// assert_eq!("No cause", chain.to_string());
/// ```
///
/// Other standard traits (like [`Debug`][std::fmt::Debug], [`Clone`] and some
/// others) are automatically derived for the convenience using the standard
/// derive macros. If you need another trait, feel free to submit a PR and/or
/// use the [`DisplayErrorChain::into_inner`] method to access the wrapped
/// error.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DisplayErrorChain<E>(E);

impl<E: Error> From<E> for DisplayErrorChain<E> {
Expand Down

0 comments on commit 3e397c9

Please sign in to comment.