From 1e503a8d3be3994f5e88b505a7e6d702c78230da Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 17 Jan 2025 13:28:21 +1100 Subject: [PATCH 1/2] 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 --- io/src/error.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/io/src/error.rs b/io/src/error.rs index 172dd3d6a..6ef943e42 100644 --- a/io/src/error.rs +++ b/io/src/error.rs @@ -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")] From 0719997feef4ef8b2686e570d4083f88be9c5bb0 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 17 Jan 2025 13:31:55 +1100 Subject: [PATCH 2/2] api: Run just check-api --- api/io/all-features.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/io/all-features.txt b/api/io/all-features.txt index 8f3698e43..1a6cb4f7a 100644 --- a/api/io/all-features.txt +++ b/api/io/all-features.txt @@ -239,8 +239,6 @@ pub fn bitcoin_io::Cursor::inner(&self) -> &T pub fn bitcoin_io::Cursor::into_inner(self) -> T pub fn bitcoin_io::Cursor::read(&mut self, buf: &mut [u8]) -> bitcoin_io::Result pub fn bitcoin_io::Cursor::set_position(&mut self, position: u64) -pub fn bitcoin_io::Error::cause(&self) -> core::option::Option<&dyn core::error::Error> -pub fn bitcoin_io::Error::description(&self) -> &str pub fn bitcoin_io::Error::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin_io::Error::fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> core::result::Result<(), core::fmt::Error> pub fn bitcoin_io::Error::from(kind: bitcoin_io::ErrorKind) -> bitcoin_io::Error