From da3bbc87d7cde34bff29ca191d9fa43662b76c0a Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 2 May 2024 12:58:31 -0700 Subject: [PATCH] doc(examples): Fix a bug where type SimpleFileOptions must be specified --- examples/append.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/append.rs b/examples/append.rs index 8bb1e4d8..6c5e41d9 100644 --- a/examples/append.rs +++ b/examples/append.rs @@ -1,9 +1,11 @@ use std::{ fs::{File, OpenOptions}, + io::{Read, Write}, path::{Path, PathBuf}, str::FromStr, }; use zip; +use zip::write::SimpleFileOptions; fn gather_files<'a, T: Into<&'a Path>>(path: T, files: &mut Vec) { let path: &Path = path.into(); @@ -46,7 +48,7 @@ fn real_main() -> i32 { for file in files { append_zip - .start_file_from_path(file, Default::default()) + .start_file(file.to_string_lossy(), SimpleFileOptions::default()) .unwrap(); let mut f = File::open(file).unwrap();