diff --git a/tsar-rs/Cargo.toml b/tsar-rs/Cargo.toml index e459215..1afd55b 100644 --- a/tsar-rs/Cargo.toml +++ b/tsar-rs/Cargo.toml @@ -15,7 +15,7 @@ protobuf = "3.1.0" sha1 = "0.10.1" smallvec = "1.9.0" thiserror = "1.0.31" -zip = { version = "0.6.2", default-features = false, features = ["deflate"] } +zip = { version = "1.1.1", default-features = false, features = ["deflate"] } zstd = "0.13.0" [target.'cfg(windows)'.dependencies] diff --git a/tsar-rs/src/write/mod.rs b/tsar-rs/src/write/mod.rs index c737a79..6441ef4 100644 --- a/tsar-rs/src/write/mod.rs +++ b/tsar-rs/src/write/mod.rs @@ -8,7 +8,7 @@ use std::{ use base64::Engine; use protobuf::{CodedOutputStream, EnumOrUnknown, Message}; use sha1::{Digest, Sha1}; -use zip::write::FileOptions; +use zip::write::SimpleFileOptions; use crate::{compress, paths, pb, result::Result, DataType}; @@ -40,7 +40,7 @@ impl Builder { pub fn add_file(&mut self, name: impl Into, mut reader: impl Read) -> Result<()> { let name = name.into(); self.z - .start_file(name.clone(), FileOptions::default().large_file(true))?; + .start_file(name.clone(), SimpleFileOptions::default().large_file(true))?; std::io::copy(&mut reader, &mut self.z)?; self.meta.raw_files.push(pb::RawFile { name, @@ -114,7 +114,7 @@ impl Builder { pub fn finish(&mut self) -> Result<()> { self.z - .start_file(paths::BUNDLE_META_PATH, FileOptions::default())?; + .start_file(paths::BUNDLE_META_PATH, SimpleFileOptions::default())?; self.meta.blobs.sort_by(|a, b| a.name.cmp(&b.name)); // TODO check target_file contiguous self.meta @@ -135,7 +135,7 @@ impl Builder { if !self.chunks.contains(&result) { self.z.start_file( paths::chunk_path(&result), - FileOptions::default() + SimpleFileOptions::default() .compression_method(if blob.compression_stages.is_empty() { // use zip compression when no custom compression stage zip::CompressionMethod::DEFLATE