From d2e7afef39d4ee12e9d4cb0190c6ce400d41aaa2 Mon Sep 17 00:00:00 2001 From: Niv Date: Wed, 24 May 2017 18:28:55 +0000 Subject: [PATCH] keep error messages in sync --- src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 96fd9a5..671f331 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -793,8 +793,8 @@ pub struct SetLoggerError(()); impl fmt::Display for SetLoggerError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - write!(fmt, "attempted to set a logger after the logging system \ - was already initialized") + use error::Error; + fmt.write_str(self.description()) } } @@ -813,7 +813,8 @@ pub struct ShutdownLoggerError(()); impl fmt::Display for ShutdownLoggerError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - write!(fmt, "attempted to shut down the logger without an active logger") + use error::Error; + fmt.write_str(self.description()) } } @@ -830,7 +831,8 @@ pub struct LevelParseError(()); impl fmt::Display for LevelParseError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - write!(fmt, "attempted to convert a string that doesn't match an existing log level") + use error::Error; + fmt.write_str(self.description()) } }