Skip to content

Commit 9a941bc

Browse files
committed
Deprecate std::error::Error::description
1 parent 15b533d commit 9a941bc

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/address.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ impl fmt::Display for AddressError {
7575
}
7676
}
7777

78+
#[allow(deprecated)]
7879
impl error::Error for AddressError {
7980
fn cause(&self) -> Option<&error::Error> {
8081
match *self {
@@ -87,16 +88,7 @@ impl error::Error for AddressError {
8788
}
8889

8990
fn description(&self) -> &str {
90-
match *self {
91-
AddressError::Base58(ref e) => e.description(),
92-
AddressError::Bech32(ref e) => e.description(),
93-
AddressError::Blech32(ref e) => e.description(),
94-
AddressError::InvalidAddress(..) => "was unable to parse the address",
95-
AddressError::UnsupportedWitnessVersion(..) => "unsupported witness version",
96-
AddressError::InvalidBlindingPubKey(..) => "an invalid blinding pubkey was encountered",
97-
AddressError::InvalidWitnessProgramLength => "program length incompatible with version",
98-
AddressError::InvalidWitnessVersion => "invalid witness script version",
99-
}
91+
"description() is deprecated; use Display"
10092
}
10193
}
10294

src/encode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl fmt::Display for Error {
5757
}
5858
}
5959

60+
#[allow(deprecated)]
6061
impl error::Error for Error {
6162
fn cause(&self) -> Option<&error::Error> {
6263
match *self {
@@ -66,7 +67,7 @@ impl error::Error for Error {
6667
}
6768

6869
fn description(&self) -> &str {
69-
"an Elements encoding error"
70+
"description() is deprecated; use Display"
7071
}
7172
}
7273

0 commit comments

Comments
 (0)