From f975bc58525091bfbdfcd5fdf6c87fce64cc5f65 Mon Sep 17 00:00:00 2001 From: meh Date: Wed, 9 Dec 2020 01:56:18 +0100 Subject: [PATCH] fix: use Display instead of std::error::Error::description --- src/util/error.rs | 2 +- src/util/format/pixel.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/error.rs b/src/util/error.rs index 2c41c62..5aa2a14 100644 --- a/src/util/error.rs +++ b/src/util/error.rs @@ -120,7 +120,7 @@ impl From for io::Error { impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - f.write_str(error::Error::description(self)) + f.write_str(&self.to_string()) } } diff --git a/src/util/format/pixel.rs b/src/util/format/pixel.rs index 28e6e10..51cdf22 100644 --- a/src/util/format/pixel.rs +++ b/src/util/format/pixel.rs @@ -924,8 +924,8 @@ impl fmt::Display for ParsePixelError { impl error::Error for ParsePixelError { fn description(&self) -> &str { match *self { - ParsePixelError::NulError(ref e) => e.description(), - ParsePixelError::UnknownFormat => "unknown pixel format", + ParsePixelError::NulError(ref e) => e.to_string(), + ParsePixelError::UnknownFormat => "unknown pixel format".to_string(), } }