Skip to content

Commit 4aeec76

Browse files
authored
Merge pull request #21 from erasmospunk/master
Remove deprecated Error::description
2 parents 803dd0c + 56dc73f commit 4aeec76

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/error.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,7 @@ pub enum Error {
4646

4747
impl error::Error for Error {
4848
fn description(&self) -> &str {
49-
match *self {
50-
Error::Passphrase => "wrong passphrase",
51-
Error::Network => "wrong network",
52-
Error::Unsupported(s) => s,
53-
Error::Mnemonic(s) => s,
54-
Error::IO(ref err) => err.description(),
55-
Error::KeyDerivation(ref err) => err.description(),
56-
Error::SecpError(ref err) => err.description(),
57-
Error::SymmetricCipherError(ref err) => match err {
58-
&symmetriccipher::SymmetricCipherError::InvalidLength => "invalid length",
59-
&symmetriccipher::SymmetricCipherError::InvalidPadding => "invalid padding",
60-
},
61-
}
49+
"description() is deprecated; use Display"
6250
}
6351

6452
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
@@ -110,8 +98,7 @@ impl convert::From<Error> for io::Error {
11098
match err {
11199
Error::IO(e) => e,
112100
_ => {
113-
use std::error::Error;
114-
io::Error::new(io::ErrorKind::Other, err.description())
101+
io::Error::new(io::ErrorKind::Other, err.to_string())
115102
}
116103
}
117104
}

0 commit comments

Comments
 (0)