Skip to content

Commit

Permalink
Simplify Error's Display impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyla Hellyer committed Nov 11, 2017
1 parent d5a9aa8 commit ee2bbca
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,7 @@ impl From<WebSocketError> 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())
}
}

Expand Down

0 comments on commit ee2bbca

Please sign in to comment.