bug: Fix reading bundle properties

Clippy's suggestion failed me, as `slice::take` only yields _at most_
the given number of elements, but `Vec::with_capacity` doesn't resize
in a way that it would yield `capacity` elements.
This commit is contained in:
Lucas Schwiderski 2023-01-07 16:16:14 +01:00
parent db7790ec5b
commit 0811f47ae2
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -88,7 +88,7 @@ impl EntryHeader {
pub struct Bundle {
format: BundleFormat,
properties: Vec<Murmur64>,
properties: [Murmur64; 32],
_headers: Vec<EntryHeader>,
files: Vec<BundleFile>,
name: String,
@ -125,7 +125,7 @@ impl Bundle {
let num_entries = r.read_u32()? as usize;
let mut properties = Vec::with_capacity(32);
let mut properties = [0.into(); 32];
for prop in properties.iter_mut().take(32) {
*prop = Murmur64::from(r.read_u64()?);
}