Remove usage of deprecated std::error::Error methods (#1206) (#1245)

This commit is contained in:
Steffen Butzer
2019-07-03 23:06:03 -07:00
committed by Carl Lerche
parent 516251052d
commit 0651f09427
17 changed files with 70 additions and 186 deletions
+2 -6
View File
@@ -940,12 +940,8 @@ impl fmt::Debug for FrameTooBig {
impl fmt::Display for FrameTooBig {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.description())
f.write_str("frame size too big")
}
}
impl StdError for FrameTooBig {
fn description(&self) -> &str {
"frame size too big"
}
}
impl StdError for FrameTooBig {}
+2 -9
View File
@@ -80,15 +80,8 @@ impl fmt::Display for RunError {
}
impl Error for RunError {
fn description(&self) -> &str {
self.inner.description()
}
// FIXME(taiki-e): When the minimum support version of tokio reaches Rust 1.30,
// replace this with Error::source.
#[allow(deprecated)]
fn cause(&self) -> Option<&dyn Error> {
self.inner.cause()
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.inner.source()
}
}