mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-23 00:00:10 +02:00
Allow deprecated Error::cause (#818)
Error::cause is deprecated in Rust 1.33, but this allows Error::cause until the minimum supported version of tokio is Rust 1.30. When the minimum support version of tokio reaches Rust 1.30, replace Error::cause with Error::source. Fixes: #817
This commit is contained in:
@@ -92,6 +92,10 @@ 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<&Error> {
|
||||
self.inner.cause()
|
||||
}
|
||||
|
||||
@@ -161,6 +161,9 @@ impl<T: StdError + 'static> StdError for ThrottleError<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// 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<&StdError> {
|
||||
match self.0 {
|
||||
Either::A(ref err) => Some(err),
|
||||
|
||||
Reference in New Issue
Block a user