Remove deprecated Error::description impl

This commit is contained in:
Elichai Turkel 2020-09-14 17:56:46 +03:00
parent 023fae1f65
commit 2d70623356
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F
13 changed files with 5 additions and 68 deletions

View File

@ -120,12 +120,7 @@ impl fmt::Display for Error {
} }
} }
#[allow(deprecated)] impl error::Error for Error {}
impl error::Error for Error {
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}
#[cfg(feature="bitcoinconsensus")] #[cfg(feature="bitcoinconsensus")]
#[doc(hidden)] #[doc(hidden)]

View File

@ -128,12 +128,7 @@ impl fmt::Display for ParseOutPointError {
} }
} }
#[allow(deprecated)]
impl error::Error for ParseOutPointError { impl error::Error for ParseOutPointError {
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
fn cause(&self) -> Option<&dyn error::Error> { fn cause(&self) -> Option<&dyn error::Error> {
match *self { match *self {
ParseOutPointError::Txid(ref e) => Some(e), ParseOutPointError::Txid(ref e) => Some(e),

View File

@ -109,7 +109,6 @@ impl fmt::Display for Error {
} }
} }
#[allow(deprecated)]
impl error::Error for Error { impl error::Error for Error {
fn cause(&self) -> Option<&dyn error::Error> { fn cause(&self) -> Option<&dyn error::Error> {
match *self { match *self {
@ -126,10 +125,6 @@ impl error::Error for Error {
| Error::UnknownInventoryType(..) => None, | Error::UnknownInventoryType(..) => None,
} }
} }
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
} }
#[doc(hidden)] #[doc(hidden)]

View File

@ -60,11 +60,7 @@ impl From<io::Error> for Error {
} }
} }
#[allow(deprecated)]
impl error::Error for Error { impl error::Error for Error {
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
fn cause(&self) -> Option<&dyn error::Error> { fn cause(&self) -> Option<&dyn error::Error> {
match *self { match *self {

View File

@ -87,7 +87,6 @@ impl fmt::Display for Error {
} }
} }
#[allow(deprecated)]
impl error::Error for Error { impl error::Error for Error {
fn cause(&self) -> Option<&dyn error::Error> { fn cause(&self) -> Option<&dyn error::Error> {
match *self { match *self {
@ -96,10 +95,6 @@ impl error::Error for Error {
_ => None, _ => None,
} }
} }
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
} }
#[doc(hidden)] #[doc(hidden)]

View File

@ -115,13 +115,7 @@ impl fmt::Display for ParseAmountError {
} }
} }
#[allow(deprecated)] impl error::Error for ParseAmountError {}
impl error::Error for ParseAmountError {
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}
fn is_too_precise(s: &str, precision: usize) -> bool { fn is_too_precise(s: &str, precision: usize) -> bool {
s.contains('.') || precision >= s.len() || s.chars().rev().take(precision).any(|d| d != '0') s.contains('.') || precision >= s.len() || s.chars().rev().take(precision).any(|d| d != '0')

View File

@ -52,12 +52,7 @@ impl fmt::Display for Error {
} }
} }
#[allow(deprecated)] impl error::Error for Error {}
impl error::Error for Error {
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}
/// Vector-like object that holds the first 100 elements on the stack. If more space is needed it /// Vector-like object that holds the first 100 elements on the stack. If more space is needed it
/// will be allocated on the heap. /// will be allocated on the heap.

View File

@ -75,12 +75,7 @@ pub enum Error {
Io(io::Error), Io(io::Error),
} }
#[allow(deprecated)] impl error::Error for Error {}
impl error::Error for Error {
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}
impl Display for Error { impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {

View File

@ -411,10 +411,6 @@ impl error::Error for Error {
None None
} }
} }
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
} }
impl From<secp256k1::Error> for Error { impl From<secp256k1::Error> for Error {

View File

@ -71,7 +71,6 @@ impl fmt::Display for Error {
} }
} }
#[allow(deprecated)]
impl error::Error for Error { impl error::Error for Error {
fn cause(&self) -> Option<&dyn error::Error> { fn cause(&self) -> Option<&dyn error::Error> {
match *self { match *self {
@ -80,10 +79,6 @@ impl error::Error for Error {
_ => None _ => None
} }
} }
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
} }
/// An element of a script template /// An element of a script template

View File

@ -52,10 +52,6 @@ impl error::Error for Error {
Error::Secp256k1(ref e) => Some(e), Error::Secp256k1(ref e) => Some(e),
} }
} }
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
} }
#[doc(hidden)] #[doc(hidden)]

View File

@ -83,7 +83,6 @@ impl fmt::Display for Error {
} }
} }
#[allow(deprecated)]
impl error::Error for Error { impl error::Error for Error {
fn cause(&self) -> Option<&dyn error::Error> { fn cause(&self) -> Option<&dyn error::Error> {
match *self { match *self {
@ -92,10 +91,6 @@ impl error::Error for Error {
Error::BlockBadProofOfWork | Error::BlockBadTarget => None Error::BlockBadProofOfWork | Error::BlockBadTarget => None
} }
} }
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
} }
#[doc(hidden)] #[doc(hidden)]

View File

@ -69,9 +69,4 @@ impl fmt::Display for Error {
} }
} }
#[allow(deprecated)] impl error::Error for Error {}
impl error::Error for Error {
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
}