From b39df21ba888b801b9f3d85a90b10a5ebcd6ee1b Mon Sep 17 00:00:00 2001 From: CoffmanLevi <55849149+CoffmanLevi@users.noreply.github.com> Date: Tue, 29 Dec 2020 23:27:32 -0800 Subject: [PATCH] Made the debug text for Error include any sub-errors (#232) --- src/error.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/error.rs b/src/error.rs index b1c8cda..9909e1c 100644 --- a/src/error.rs +++ b/src/error.rs @@ -14,7 +14,7 @@ pub enum Error { UpdateFailed(String), } -impl fmt::Debug for Error { +impl fmt::Display for Error { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { Error::MenusNotSupported => write!(formatter, "Menus not supported"), @@ -25,13 +25,13 @@ impl fmt::Debug for Error { } } -impl fmt::Display for Error { +impl fmt::Debug for Error { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { match *self { - Error::MenusNotSupported => write!(fmt, "{:?}", self), - Error::MenuExists(ref e) => write!(fmt, "{:?} {:?}", self, e), - Error::WindowCreate(ref e) => write!(fmt, "{:?} {:?}", self, e), - Error::UpdateFailed(ref e) => write!(fmt, "{:?} {:?}", self, e), + Error::MenusNotSupported => write!(fmt, "{}", self), + Error::MenuExists(ref e) => write!(fmt, "{}, {:?}", self, e), + Error::WindowCreate(ref e) => write!(fmt, "{}, {:?}", self, e), + Error::UpdateFailed(ref e) => write!(fmt, "{}, {:?}", self, e), } } }