Skip to content

Commit

Permalink
upd zip
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegenes committed May 7, 2024
1 parent c8aa16f commit f4a038f
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 7 deletions.
97 changes: 94 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/directsketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@ async fn dl_sketch_accession(
Ok((sigs, failed))
}

fn write_sig(
fn write_sig<T: zip::write::FileOptionExtension>(
sig: &Signature,
md5sum_occurrences: &mut HashMap<String, usize>,
manifest_rows: &mut Vec<Record>,
zip_f: &mut ZipWriter<std::fs::File>,
zip_options: zip::write::FileOptions,
zip_options: zip::write::FileOptions<T>,
) -> Result<()> {
let md5sum_str = sig.md5sum();
let count = md5sum_occurrences.entry(md5sum_str.clone()).or_insert(0);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit f4a038f

Please sign in to comment.