Refactor: don't search for src_data twice
This commit is contained in:
parent
d5681d9ede
commit
9a47bbb6c8
1 changed files with 4 additions and 1 deletions
|
@ -320,7 +320,10 @@ impl<A: Read + Write + Seek> ZipWriter<A> {
|
|||
compressed_size,
|
||||
uncompressed_size,
|
||||
};
|
||||
let mut reader = BufReader::new(ZipFileReader::Raw(find_content(&data, self.inner.get_plain())?));
|
||||
let mut reader = BufReader::new(ZipFileReader::Raw(find_content(
|
||||
&src_data.to_owned(),
|
||||
self.inner.get_plain(),
|
||||
)?));
|
||||
let mut copy = Vec::with_capacity(compressed_size as usize);
|
||||
reader.read_to_end(&mut copy)?;
|
||||
drop(reader);
|
||||
|
|
Loading…
Add table
Reference in a new issue