Skip to content

Commit

Permalink
Merge pull request #109 from tertsdiepraam/impl-debug-for-error
Browse files Browse the repository at this point in the history
implement Debug for ErrorKind
  • Loading branch information
cakebaker authored Mar 23, 2024
2 parents c9c2c75 + 207e291 commit c380e9d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl StdError for Error {}

impl Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.kind.fmt(f)
std::fmt::Display::fmt(&self.kind, f)
}
}

Expand All @@ -76,6 +76,12 @@ impl Debug for Error {
}
}

impl Debug for ErrorKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self, f)
}
}

impl Display for ErrorKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "error: ")?;
Expand Down

0 comments on commit c380e9d

Please sign in to comment.