fix: use Display instead of std::error::Error::description

This commit is contained in:
meh
2020-12-09 01:56:18 +01:00
parent 69befd291b
commit f975bc5852
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ impl From<Error> 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())
}
}
+2 -2
View File
@@ -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(),
}
}