Skip to content

Commit

Permalink
Add intos for Short
Browse files Browse the repository at this point in the history
  • Loading branch information
ruffson committed Nov 2, 2020
1 parent 8e2bf09 commit 0a0779c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/decoder/ifd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl Value {

pub fn into_u32(self) -> TiffResult<u32> {
match self {
Short(val) => Ok(val.into()),
Unsigned(val) => Ok(val),
UnsignedBig(val) => Ok(u32::try_from(val)?),
val => Err(TiffError::FormatError(
Expand All @@ -76,6 +77,7 @@ impl Value {

pub fn into_u64(self) -> TiffResult<u64> {
match self {
Short(val) => Ok(val.into()),
Unsigned(val) => Ok(val.into()),
UnsignedBig(val) => Ok(val),
val => Err(TiffError::FormatError(
Expand Down

0 comments on commit 0a0779c

Please sign in to comment.