From ee2bbcaa0b62c09a6c0df352bfddcbf99d06e61d Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Sat, 11 Nov 2017 08:45:48 -0800 Subject: Simplify Error's `Display` impl --- src/error.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 508578b..ed5a928 100644 --- a/src/error.rs +++ b/src/error.rs @@ -154,17 +154,7 @@ impl From for Error { impl Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - Error::Io(ref inner) => inner.fmt(f), - Error::Json(ref inner) => inner.fmt(f), - #[cfg(feature = "http")] - Error::Hyper(ref inner) => inner.fmt(f), - #[cfg(feature = "gateway")] - Error::WebSocket(ref inner) => inner.fmt(f), - #[cfg(feature = "voice")] - Error::Opus(ref inner) => inner.fmt(f), - _ => f.write_str(self.description()), - } + f.write_str(self.description()) } } -- cgit v1.2.3