summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColvin Wellborn <39858617+colvin@users.noreply.github.com>2020-03-19 00:06:51 -0400
committerGitHub <noreply@github.com>2020-03-19 00:06:51 -0400
commitf8b1e09699eb96bf1af72ba48b607267c8a39bdc (patch)
tree94301ec72ca41c19e9c700ae0e9ddf11983e057a
parentd3a8d575264960bdffc420f0728876e2979460a9 (diff)
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`
-rw-r--r--src/errors.rs15
1 files changed, 1 insertions, 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),