Remove deprecated std::error::Error trait method impls

The `description` method was deprecated in Rust `v1.42`. The `cause`
method was deprecated in Rust `v1.33`. Our MSRV is now Rust `v1.63`.

We do not need to implement the deprecated functions any longer.

Fix: #3869
This commit is contained in:
Tobin C. Harding 2025-01-17 13:28:21 +11:00
parent dc76043dcf
commit 1e503a8d3b
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 0 additions and 13 deletions

View File

@ -76,19 +76,6 @@ impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
self.error.as_ref().and_then(|e| e.as_ref().source()) self.error.as_ref().and_then(|e| e.as_ref().source())
} }
#[allow(deprecated)]
fn description(&self) -> &str {
match self.error.as_ref() {
Some(e) => e.description(),
None => self.kind.description(),
}
}
#[allow(deprecated)]
fn cause(&self) -> Option<&dyn std::error::Error> {
self.error.as_ref().and_then(|e| e.as_ref().cause())
}
} }
#[cfg(feature = "std")] #[cfg(feature = "std")]