Make the Unknown field optional
Several other uses that currently rely on num-traits for conversion have no Unknown representation. Thus, the converter now outputs only known variants or an error and the exposing function then can put the error value into an Unknown variant instead.
This commit is contained in:
1 parent
ffdeb62b9f
commit
f80f4a06d5
2 files changed
+30
-13
No files matched your search
+1
-1
@@ -454,7 +454,7 @@ impl<R: Read + Seek> Decoder<R> {
|
||||
// Value 4 bytes either a pointer the value itself
|
||||
fn read_entry(&mut self) -> TiffResult<Option<(ifd::Tag, ifd::Entry)>> {
|
||||
let tag = ifd::Tag::from_u16(self.read_short()?);
|
||||
let type_: ifd::Type = match FromPrimitive::from_u16(self.read_short()?) {
|
||||
let type_ = match ifd::Type::from_u16(self.read_short()?) {
|
||||
Some(t) => t,
|
||||
None => {
|
||||
// Unknown type. Skip this entry according to spec.
|
||||
|
||||
Reference in new issue
Block a user