Skip to content

Commit 7faf4df

Browse files
committed
Remove deprecated Error description, replaced by Display
The Display trait is already implemented, so this is only a code deletion. Fixes 1.42-nightly warning: warning: use of deprecated item 'std::error::Error::description': use the Display impl or to_string() --> src/protocol/mod.rs:981:40 | 981 | Error::IOError(ref e) => e.description(), | ^^^^^^^^^^^ | = note: `#[warn(deprecated)]` on by default
1 parent d1ab03c commit 7faf4df

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

protocol/mod.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -973,18 +973,7 @@ impl convert::From<reqwest::Error> for Error {
973973
}
974974
}
975975

976-
impl ::std::error::Error for Error {
977-
fn description(&self) -> &str {
978-
match *self {
979-
Error::Err(ref val) => &val[..],
980-
Error::Disconnect(_) => "Disconnect",
981-
Error::IOError(ref e) => e.description(),
982-
Error::Json(ref e) => e.description(),
983-
#[cfg(not(target_arch = "wasm32"))]
984-
Error::Reqwest(ref e) => e.description(),
985-
}
986-
}
987-
}
976+
impl ::std::error::Error for Error {}
988977

989978
impl ::std::fmt::Display for Error {
990979
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {

0 commit comments

Comments
 (0)