From f8b1e09699eb96bf1af72ba48b607267c8a39bdc Mon Sep 17 00:00:00 2001 From: Colvin Wellborn <39858617+colvin@users.noreply.github.com> Date: Thu, 19 Mar 2020 00:06:51 -0400 Subject: Update errors to match current Error trait (#223) - `description` is deprecated, and now with the 1.42 stable release these are generating warnings - `cause` is deprecated and replaced by `source` --- src/errors.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index f0f70d7..5506198 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -65,20 +65,7 @@ impl fmt::Display for Error { } impl StdError for Error { - fn description(&self) -> &str { - match self { - Error::SerdeJsonError(e) => e.description(), - Error::Hyper(e) => e.description(), - Error::Http(e) => e.description(), - Error::IO(e) => e.description(), - Error::Encoding(e) => e.description(), - Error::InvalidResponse(msg) => msg.as_str(), - Error::Fault { message, .. } => message.as_str(), - Error::ConnectionNotUpgraded => "connection not upgraded", - } - } - - fn cause(&self) -> Option<&dyn StdError> { + fn source(&self) -> Option<&(dyn StdError + 'static)> { match self { Error::SerdeJsonError(ref err) => Some(err), Error::Http(ref err) => Some(err), -- cgit v1.2.3