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:
parent
db7790ec5b
commit
0811f47ae2
1 changed files with 2 additions and 2 deletions
|
@ -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()?);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue