Skip to content

Commit

Permalink
Use SimpleFileOptions instead of FileOptions to match new zip 1.1 API
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-c committed Sep 25, 2024
1 parent c4f5315 commit 3399586
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::{env, fs};
use walkdir::WalkDir;
use zip::write::FileOptions;
use zip::write::SimpleFileOptions;
use zip::ZipWriter;

fn get_tool(name: &str, default: &str) -> String {
Expand Down Expand Up @@ -424,7 +424,7 @@ fn create_zip(zip_path: &Path, base_dir: &Path, base_dir_in_zip: Option<&str>, f
None => filename_in_zip.to_string(),
};

zip.start_file(filename_in_zip, FileOptions::default())
zip.start_file(filename_in_zip, SimpleFileOptions::default())
.unwrap_or_else(|_| panic!("Cannot create zip for {:?}", zip_path));
zip.write_all(content.as_slice())
.unwrap_or_else(|_| panic!("Cannot write {:?}", zip_path));
Expand All @@ -436,7 +436,7 @@ fn create_zip(zip_path: &Path, base_dir: &Path, base_dir_in_zip: Option<&str>, f
while let Some(parent) = path {
let ancestor = parent.to_str().unwrap();
if !ancestor.is_empty() {
zip.add_directory(ancestor, FileOptions::default())
zip.add_directory(ancestor, SimpleFileOptions::default())
.unwrap_or_else(|_| panic!("Cannot add a directory"));
}
path = parent.parent();
Expand Down

0 comments on commit 3399586

Please sign in to comment.