From 0d717640511556846d04ba5152f1837baffde609 Mon Sep 17 00:00:00 2001 From: Andrii Radyk Date: Tue, 17 Dec 2019 09:26:46 +0100 Subject: [PATCH] remove deprecated Error::description --- src/kv/error.rs | 6 +----- src/lib.rs | 14 +++----------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/kv/error.rs b/src/kv/error.rs index baf103a22..640705fd3 100644 --- a/src/kv/error.rs +++ b/src/kv/error.rs @@ -66,11 +66,7 @@ mod std_support { } } - impl error::Error for Error { - fn description(&self) -> &str { - "key values error" - } - } + impl error::Error for Error {} impl From for Error { fn from(err: io::Error) -> Self { diff --git a/src/lib.rs b/src/lib.rs index 97673df27..a7547610e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1330,11 +1330,7 @@ impl fmt::Display for SetLoggerError { // The Error trait is not available in libcore #[cfg(feature = "std")] -impl error::Error for SetLoggerError { - fn description(&self) -> &str { - SET_LOGGER_ERROR - } -} +impl error::Error for SetLoggerError {} /// The type returned by [`from_str`] when the string doesn't match any of the log levels. /// @@ -1351,11 +1347,7 @@ impl fmt::Display for ParseLevelError { // The Error trait is not available in libcore #[cfg(feature = "std")] -impl error::Error for ParseLevelError { - fn description(&self) -> &str { - LEVEL_PARSE_ERROR - } -} +impl error::Error for ParseLevelError {} /// Returns a reference to the logger. /// @@ -1579,7 +1571,7 @@ mod tests { use std::error::Error; let e = SetLoggerError(()); assert_eq!( - e.description(), + &e.to_string(), "attempted to set a logger after the logging system \ was already initialized" );