Skip to content

Commit

Permalink
Merge pull request #379 from jqnatividad/use-chunks-insteadof-chunkse…
Browse files Browse the repository at this point in the history
…xact

 Use `chunks` instead of `chunks_exact`
  • Loading branch information
tafia authored Dec 12, 2023
2 parents 3c74204 + e209e92 commit 1f95e96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macro_rules! from_err {
/// Converts a &[u8] into an iterator of `u32`s
pub fn to_u32(s: &[u8]) -> impl ExactSizeIterator<Item = u32> + '_ {
assert_eq!(s.len() % 4, 0);
s.chunks_exact(4)
s.chunks(4)
.map(|data| u32::from_le_bytes(data.try_into().unwrap()))
}

Expand Down

0 comments on commit 1f95e96

Please sign in to comment.