Skip to content

Commit

Permalink
upgrade rust-version to 1.80; cast body_size as usize
Browse files Browse the repository at this point in the history
  • Loading branch information
mindeng committed Sep 26, 2024
1 parent 99bc38b commit a421a7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "nom-exif"
rust-version = "1.80"
version = "2.0.2"
edition = "2021"
license-file = "LICENSE"
Expand Down
5 changes: 0 additions & 5 deletions src/exif/exif_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,11 +816,6 @@ impl IfdEntry {
}

pub(crate) const SUBIFD_TAGS: &[u16] = &[ExifTag::ExifOffset.code(), ExifTag::GPSInfo.code()];
const TZ_OFFSET_TAGS: &[u16] = &[
ExifTag::OffsetTimeOriginal.code(),
ExifTag::OffsetTimeDigitized.code(),
ExifTag::OffsetTime.code(),
];

impl Iterator for IfdIter {
type Item = (Option<ExifTagCode>, IfdEntry);
Expand Down
6 changes: 4 additions & 2 deletions src/mov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ pub(crate) fn extract_moov_body_from_buf(input: &[u8]) -> Result<Range<usize>, P
return Err(ParsingError::ClearAndSkip(to_skip + input.len()));
}

let (_, body) = streaming::take(header.body_size())(remain)
.map_err(|e| convert_error(e, "moov is too small"))?;
assert!(header.body_size() <= usize::MAX.try_into().expect("should be fit"));
let size: usize = header.body_size().try_into().unwrap();
let (_, body) =
streaming::take(size)(remain).map_err(|e| convert_error(e, "moov is too small"))?;

Ok(skipped..skipped + body.len())
}
Expand Down

0 comments on commit a421a7f

Please sign in to comment.