From f4a038fecf9bc7cb55394f5a5cc83191b6cb7734 Mon Sep 17 00:00:00 2001 From: "N. Tessa Pierce-Ward" Date: Mon, 6 May 2024 17:35:54 -0700 Subject: [PATCH] upd zip --- Cargo.lock | 97 +++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 2 +- src/directsketch.rs | 6 +-- 3 files changed, 98 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ffb1959..1e7d860 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,6 +73,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "autocfg" version = "1.2.0" @@ -398,6 +407,28 @@ dependencies = [ "memchr", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "either" version = "1.11.0" @@ -1207,6 +1238,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "object" version = "0.32.2" @@ -1427,6 +1479,15 @@ dependencies = [ "num-integer", ] +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2258,6 +2319,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "tower" version = "0.4.13" @@ -2671,6 +2749,15 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.52.0" @@ -2707,14 +2794,18 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "zip" -version = "0.6.6" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "57c07d35c02b10a0884b033b17edb61a4d7bc443ef9a12636bb8cd2e8b8ab5ca" dependencies = [ - "byteorder", + "arbitrary", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", + "indexmap", + "num_enum", + "thiserror", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d8093df..b966f6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ sourmash = { version = "0.13.1", features=["branchwater"]} serde_json = "1.0.116" niffler = "2.4.0" needletail = "0.5.1" -zip = { version = "0.6", default-features = false, features = ["deflate"] } +zip = { version = "1.2.0", default-features = false, features = ["deflate"] } simple-error = "0.3.0" anyhow = "1.0.82" camino = "1.1.6" diff --git a/src/directsketch.rs b/src/directsketch.rs index 5b87273..99b67c4 100644 --- a/src/directsketch.rs +++ b/src/directsketch.rs @@ -299,12 +299,12 @@ async fn dl_sketch_accession( Ok((sigs, failed)) } -fn write_sig( +fn write_sig( sig: &Signature, md5sum_occurrences: &mut HashMap, manifest_rows: &mut Vec, zip_f: &mut ZipWriter, - zip_options: zip::write::FileOptions, + zip_options: zip::write::FileOptions, ) -> Result<()> { let md5sum_str = sig.md5sum(); let count = md5sum_occurrences.entry(md5sum_str.clone()).or_insert(0); @@ -377,7 +377,7 @@ pub async fn download_and_sketch( let outpath: PathBuf = output_sigs.into(); let mut zip_f = ZipWriter::new(std::fs::File::create(&outpath)?); // zip options - let options = zip::write::FileOptions::default() + let options = zip::write::SimpleFileOptions::default() .compression_method(zip::CompressionMethod::Stored) .large_file(true);