From 2d706233566558a12d64b2f6a162fd23ed87ba52 Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Mon, 14 Sep 2020 17:56:46 +0300 Subject: [PATCH] Remove deprecated Error::description impl --- src/blockdata/script.rs | 7 +------ src/blockdata/transaction.rs | 5 ----- src/consensus/encode.rs | 5 ----- src/network/mod.rs | 4 ---- src/util/address.rs | 5 ----- src/util/amount.rs | 8 +------- src/util/base58.rs | 7 +------ src/util/bip158.rs | 7 +------ src/util/bip32.rs | 4 ---- src/util/contracthash.rs | 5 ----- src/util/key.rs | 4 ---- src/util/mod.rs | 5 ----- src/util/psbt/error.rs | 7 +------ 13 files changed, 5 insertions(+), 68 deletions(-) diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index 8cb468f0..54caed7b 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -120,12 +120,7 @@ impl fmt::Display for Error { } } -#[allow(deprecated)] -impl error::Error for Error { - fn description(&self) -> &str { - "description() is deprecated; use Display" - } -} +impl error::Error for Error {} #[cfg(feature="bitcoinconsensus")] #[doc(hidden)] diff --git a/src/blockdata/transaction.rs b/src/blockdata/transaction.rs index 06f36a85..b5a098cb 100644 --- a/src/blockdata/transaction.rs +++ b/src/blockdata/transaction.rs @@ -128,12 +128,7 @@ impl fmt::Display for ParseOutPointError { } } -#[allow(deprecated)] impl error::Error for ParseOutPointError { - fn description(&self) -> &str { - "description() is deprecated; use Display" - } - fn cause(&self) -> Option<&dyn error::Error> { match *self { ParseOutPointError::Txid(ref e) => Some(e), diff --git a/src/consensus/encode.rs b/src/consensus/encode.rs index 32aa9512..bdda57c7 100644 --- a/src/consensus/encode.rs +++ b/src/consensus/encode.rs @@ -109,7 +109,6 @@ impl fmt::Display for Error { } } -#[allow(deprecated)] impl error::Error for Error { fn cause(&self) -> Option<&dyn error::Error> { match *self { @@ -126,10 +125,6 @@ impl error::Error for Error { | Error::UnknownInventoryType(..) => None, } } - - fn description(&self) -> &str { - "description() is deprecated; use Display" - } } #[doc(hidden)] diff --git a/src/network/mod.rs b/src/network/mod.rs index c541f186..dd02976a 100644 --- a/src/network/mod.rs +++ b/src/network/mod.rs @@ -60,11 +60,7 @@ impl From for Error { } } -#[allow(deprecated)] impl error::Error for Error { - fn description(&self) -> &str { - "description() is deprecated; use Display" - } fn cause(&self) -> Option<&dyn error::Error> { match *self { diff --git a/src/util/address.rs b/src/util/address.rs index 17361575..917fa4d5 100644 --- a/src/util/address.rs +++ b/src/util/address.rs @@ -87,7 +87,6 @@ impl fmt::Display for Error { } } -#[allow(deprecated)] impl error::Error for Error { fn cause(&self) -> Option<&dyn error::Error> { match *self { @@ -96,10 +95,6 @@ impl error::Error for Error { _ => None, } } - - fn description(&self) -> &str { - "description() is deprecated; use Display" - } } #[doc(hidden)] diff --git a/src/util/amount.rs b/src/util/amount.rs index 5d37e36c..8c3be954 100644 --- a/src/util/amount.rs +++ b/src/util/amount.rs @@ -115,13 +115,7 @@ impl fmt::Display for ParseAmountError { } } -#[allow(deprecated)] -impl error::Error for ParseAmountError { - fn description(&self) -> &str { - "description() is deprecated; use Display" - } -} - +impl error::Error for ParseAmountError {} fn is_too_precise(s: &str, precision: usize) -> bool { s.contains('.') || precision >= s.len() || s.chars().rev().take(precision).any(|d| d != '0') diff --git a/src/util/base58.rs b/src/util/base58.rs index e307334f..13949c55 100644 --- a/src/util/base58.rs +++ b/src/util/base58.rs @@ -52,12 +52,7 @@ impl fmt::Display for Error { } } -#[allow(deprecated)] -impl error::Error for Error { - fn description(&self) -> &str { - "description() is deprecated; use Display" - } -} +impl error::Error for Error {} /// Vector-like object that holds the first 100 elements on the stack. If more space is needed it /// will be allocated on the heap. diff --git a/src/util/bip158.rs b/src/util/bip158.rs index 76e62887..0493df96 100644 --- a/src/util/bip158.rs +++ b/src/util/bip158.rs @@ -75,12 +75,7 @@ pub enum Error { Io(io::Error), } -#[allow(deprecated)] -impl error::Error for Error { - fn description(&self) -> &str { - "description() is deprecated; use Display" - } -} +impl error::Error for Error {} impl Display for Error { fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { diff --git a/src/util/bip32.rs b/src/util/bip32.rs index 8d6dcf50..0b13c3d9 100644 --- a/src/util/bip32.rs +++ b/src/util/bip32.rs @@ -411,10 +411,6 @@ impl error::Error for Error { None } } - - fn description(&self) -> &str { - "description() is deprecated; use Display" - } } impl From for Error { diff --git a/src/util/contracthash.rs b/src/util/contracthash.rs index cc53a817..271f8a63 100644 --- a/src/util/contracthash.rs +++ b/src/util/contracthash.rs @@ -71,7 +71,6 @@ impl fmt::Display for Error { } } -#[allow(deprecated)] impl error::Error for Error { fn cause(&self) -> Option<&dyn error::Error> { match *self { @@ -80,10 +79,6 @@ impl error::Error for Error { _ => None } } - - fn description(&self) -> &str { - "description() is deprecated; use Display" - } } /// An element of a script template diff --git a/src/util/key.rs b/src/util/key.rs index 83b56965..bf9b9cc3 100644 --- a/src/util/key.rs +++ b/src/util/key.rs @@ -52,10 +52,6 @@ impl error::Error for Error { Error::Secp256k1(ref e) => Some(e), } } - - fn description(&self) -> &str { - "description() is deprecated; use Display" - } } #[doc(hidden)] diff --git a/src/util/mod.rs b/src/util/mod.rs index 523c4377..74b4ace0 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -83,7 +83,6 @@ impl fmt::Display for Error { } } -#[allow(deprecated)] impl error::Error for Error { fn cause(&self) -> Option<&dyn error::Error> { match *self { @@ -92,10 +91,6 @@ impl error::Error for Error { Error::BlockBadProofOfWork | Error::BlockBadTarget => None } } - - fn description(&self) -> &str { - "description() is deprecated; use Display" - } } #[doc(hidden)] diff --git a/src/util/psbt/error.rs b/src/util/psbt/error.rs index 15ab268d..2837855b 100644 --- a/src/util/psbt/error.rs +++ b/src/util/psbt/error.rs @@ -69,9 +69,4 @@ impl fmt::Display for Error { } } -#[allow(deprecated)] -impl error::Error for Error { - fn description(&self) -> &str { - "description() is deprecated; use Display" - } -} +impl error::Error for Error {}