Fix unncessary mut

This commit is contained in:
Truman Kilen 2023-02-07 22:48:07 -06:00
parent 16305f8c95
commit 194a197360

View file

@ -98,11 +98,7 @@ impl PakReader {
&self.pak.mount_point &self.pak.mount_point
} }
pub fn get<R: Read + Seek>( pub fn get<R: Read + Seek>(&self, path: &str, reader: &mut R) -> Result<Vec<u8>, super::Error> {
&mut self,
path: &str,
reader: &mut R,
) -> Result<Vec<u8>, super::Error> {
let mut data = Vec::new(); let mut data = Vec::new();
self.read_file(path, reader, &mut data)?; self.read_file(path, reader, &mut data)?;
Ok(data) Ok(data)
@ -567,7 +563,7 @@ mod test {
let bytes = include_bytes!("../tests/packs/pack_v8b.pak"); let bytes = include_bytes!("../tests/packs/pack_v8b.pak");
let mut reader = Cursor::new(bytes); let mut reader = Cursor::new(bytes);
let mut pak_reader = super::PakReader::new_any(&mut reader, None).unwrap(); let pak_reader = super::PakReader::new_any(&mut reader, None).unwrap();
let writer = Cursor::new(vec![]); let writer = Cursor::new(vec![]);
let mut pak_writer = super::PakWriter::new( let mut pak_writer = super::PakWriter::new(
writer, writer,
@ -594,7 +590,7 @@ mod test {
let bytes = include_bytes!("../tests/packs/pack_v11.pak"); let bytes = include_bytes!("../tests/packs/pack_v11.pak");
let mut reader = Cursor::new(bytes); let mut reader = Cursor::new(bytes);
let mut pak_reader = super::PakReader::new_any(&mut reader, None).unwrap(); let pak_reader = super::PakReader::new_any(&mut reader, None).unwrap();
let writer = Cursor::new(vec![]); let writer = Cursor::new(vec![]);
let mut pak_writer = super::PakWriter::new( let mut pak_writer = super::PakWriter::new(
writer, writer,