From 207e291f55f69f8fe9238a840cde4ce167958df5 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 22 Mar 2024 23:32:24 +0100 Subject: [PATCH] implement Debug for ErrorKind --- src/error.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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: ")?;