Skip to content

Commit

Permalink
Remove deprecated std::error::Error trait method impls
Browse files Browse the repository at this point in the history
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: rust-bitcoin#3896
  • Loading branch information
tcharding committed Jan 17, 2025
1 parent dc76043 commit 8d6700f
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions io/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
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")]
Expand Down

0 comments on commit 8d6700f

Please sign in to comment.