Change an error that should never happen to Option::expect.

This commit is contained in:
KAMADA Ken'ichi 2021-01-07 22:49:33 +09:00
parent a5d8a3e618
commit 37001e4cba
1 changed files with 1 additions and 2 deletions

View File

@ -77,8 +77,7 @@ fn get_exif_attr_sub<R>(reader: &mut R)
}
if size % 2 != 0 && file_size > 0 {
file_size -= 1;
size = size.checked_add(1)
.ok_or(Error::InvalidFormat("Chunk size too big"))?;
size = size.checked_add(1).expect("ex-file_size - size > 0");
}
reader.discard_exact(size as usize)?;
}