diff --git a/src/error.rs b/src/error.rs index 0da36e5..2c168fa 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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) } } @@ -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: ")?;