Pak::read should accept reference too whoops

This commit is contained in:
spuds 2023-08-27 17:16:06 +01:00
parent f2c2255d53
commit 079693af22
No known key found for this signature in database
GPG key ID: 0B6CA6068E827C8F

View file

@ -226,13 +226,13 @@ impl<W: Write + Seek> PakWriter<W> {
impl Pak {
fn read<R: Read + Seek>(
mut reader: R,
reader: &mut R,
version: super::Version,
key: Option<&aes::Aes256>,
) -> Result<Self, super::Error> {
// read footer to get index, encryption & compression info
reader.seek(io::SeekFrom::End(-version.size()))?;
let footer = super::footer::Footer::read(&mut reader, version)?;
let footer = super::footer::Footer::read(reader, version)?;
// read index to get all the entry info
reader.seek(io::SeekFrom::Start(footer.index_offset))?;
let mut index = reader.read_len(footer.index_size as usize)?;