You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-gix-archive/decrease-zip-version.diff

36 lines
1.4 KiB

--- gix-archive-0.13.1/Cargo.toml 1970-01-01T00:00:01+00:00
+++ gix-archive-0.13.1/Cargo.toml 2024-06-01T19:27:20.047617+00:00
@@ -77,7 +77,7 @@
default-features = false
[dependencies.zip]
-version = "2.1.0"
+version = "0.6.6"
features = [
"deflate",
"time",
--- gix-archive-0.13.1/src/write.rs
+++ gix-archive-0.13.1/src/write.rs
@@ -126,7 +126,7 @@ where
NextFn: FnMut(&mut Stream) -> Result<Option<Entry<'_>>, gix_worktree_stream::entry::Error>,
{
let compression_level = match opts.format {
- Format::Zip { compression_level } => compression_level.map(|lvl| lvl as i64),
+ Format::Zip { compression_level } => compression_level.map(|lvl| lvl as i32),
_other => return write_stream(stream, next_entry, out, opts),
};
@@ -161,10 +161,10 @@ fn append_zip_entry<W: std::io::Write + std::io::Seek>(
mut entry: gix_worktree_stream::Entry<'_>,
buf: &mut Vec<u8>,
mtime: zip::DateTime,
- compression_level: Option<i64>,
+ compression_level: Option<i32>,
tree_prefix: Option<&bstr::BString>,
) -> Result<(), Error> {
- let file_opts = zip::write::FileOptions::<'_, ()>::default()
+ let file_opts = zip::write::FileOptions::default()
.compression_method(zip::CompressionMethod::Deflated)
.compression_level(compression_level)
.large_file(entry.bytes_remaining().map_or(true, |len| len > u32::MAX as usize))