Fix error handling

This commit is contained in:
ruffson committed 2020-09-26 12:23:40 +02:00
1 parent 72474b569e
commit 5fd0534ea2
2 files changed
+31 -17

No files matched your search

+4
View File
@@ -49,6 +49,7 @@ pub enum TiffFormatError {
UnsignedIntegerExpected(Value),
SignedIntegerExpected(Value),
InflateError(InflateError),
Format(String),
#[doc(hidden)]
/// Do not match against this variant. It may get removed.
__NonExhaustive,
@@ -80,6 +81,9 @@ impl fmt::Display for TiffFormatError {
write!(fmt, "Expected signed integer, {:?} found.", val)
}
InflateError(_) => write!(fmt, "Failed to decode inflate data."),
Format(ref val) => {
write!(fmt, "Invalid format: {:?}.", val)
}
__NonExhaustive => unreachable!(),
}
}