diff --git a/src/pak.rs b/src/pak.rs index e0fe0f5..898a4fa 100644 --- a/src/pak.rs +++ b/src/pak.rs @@ -10,6 +10,7 @@ pub struct Pak { pub version: Version, pub footer: super::Footer, pub mount_point: String, + pub entries: hashbrown::HashMap, } impl Pak { @@ -21,17 +22,19 @@ impl Pak { let footer = super::Footer::new(&mut reader, version)?; reader.seek(io::SeekFrom::Start(footer.offset))?; let mount_point = reader.read_string()?; - let mut entries = hashbrown::HashMap::with_capacity(reader.read_u32::()? as usize); - for _ in 0..entries.capacity() { + let len = reader.read_u32::()? as usize; + let mut entries = hashbrown::HashMap::with_capacity(len); + for _ in 0..len { entries.insert( - dbg!(reader.read_string()?), - dbg!(super::Entry::new(&mut reader, version)?), + reader.read_string()?, + super::Entry::new(&mut reader, version)?, ); } Ok(Self { version, footer, mount_point, + entries, }) } }