Skip to content

Commit f4ad565

Browse files
committed
Remove std::error::Error description method implementations
The `description` method has been soft-deprecated for some time now, and current nightly (1.41) warns upon its use: warning: use of deprecated item 'std::error::Error::description': use the Display impl or to_string() Since our `description` implementation made use of the underlying error's `description` method, we triggered that warning. Let's fix that by just getting rid of the implementation containing the offending code.
1 parent 1e7ae55 commit f4ad565

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/lib.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,14 +1238,7 @@ impl fmt::Display for EncodeError {
12381238
}
12391239
}
12401240

1241-
impl std::error::Error for EncodeError {
1242-
fn description(&self) -> &str {
1243-
match *self {
1244-
EncodeError::BadLength => "invalid data length",
1245-
EncodeError::FromUtf8Error(ref e) => e.description(),
1246-
}
1247-
}
1248-
}
1241+
impl std::error::Error for EncodeError {}
12491242

12501243
/// Encode a binary key as Z85 printable text.
12511244
///
@@ -1297,14 +1290,7 @@ impl fmt::Display for DecodeError {
12971290
}
12981291
}
12991292

1300-
impl std::error::Error for DecodeError {
1301-
fn description(&self) -> &str {
1302-
match *self {
1303-
DecodeError::BadLength => "invalid data length",
1304-
DecodeError::NulError(ref e) => e.description(),
1305-
}
1306-
}
1307-
}
1293+
impl std::error::Error for DecodeError {}
13081294

13091295
/// Decode a binary key from Z85-encoded text.
13101296
///

0 commit comments

Comments
 (0)