Skip to content

Commit

Permalink
Remove deprecated Error::description impl
Browse files Browse the repository at this point in the history
  • Loading branch information
elichai committed Oct 8, 2020
1 parent 5438430 commit fa33b1c
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 68 deletions.
7 changes: 1 addition & 6 deletions src/blockdata/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 0 additions & 5 deletions src/blockdata/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 0 additions & 5 deletions src/consensus/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -126,10 +125,6 @@ impl error::Error for Error {
| Error::UnknownInventoryType(..) => None,
}
}

fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}

#[doc(hidden)]
Expand Down
4 changes: 0 additions & 4 deletions src/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ impl From<io::Error> 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 {
Expand Down
5 changes: 0 additions & 5 deletions src/util/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -96,10 +95,6 @@ impl error::Error for Error {
_ => None,
}
}

fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}

#[doc(hidden)]
Expand Down
8 changes: 1 addition & 7 deletions src/util/amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 1 addition & 6 deletions src/util/base58.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 1 addition & 6 deletions src/util/bip158.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
4 changes: 0 additions & 4 deletions src/util/bip32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,6 @@ impl error::Error for Error {
None
}
}

fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}

impl From<secp256k1::Error> for Error {
Expand Down
5 changes: 0 additions & 5 deletions src/util/contracthash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/util/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 0 additions & 5 deletions src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)]
Expand Down
7 changes: 1 addition & 6 deletions src/util/psbt/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit fa33b1c

Please sign in to comment.