doc(examples): Fix a bug where type SimpleFileOptions must be specified
This commit is contained in:
parent
8f61ff2451
commit
da3bbc87d7
1 changed files with 3 additions and 1 deletions
|
@ -1,9 +1,11 @@
|
||||||
use std::{
|
use std::{
|
||||||
fs::{File, OpenOptions},
|
fs::{File, OpenOptions},
|
||||||
|
io::{Read, Write},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
};
|
};
|
||||||
use zip;
|
use zip;
|
||||||
|
use zip::write::SimpleFileOptions;
|
||||||
|
|
||||||
fn gather_files<'a, T: Into<&'a Path>>(path: T, files: &mut Vec<PathBuf>) {
|
fn gather_files<'a, T: Into<&'a Path>>(path: T, files: &mut Vec<PathBuf>) {
|
||||||
let path: &Path = path.into();
|
let path: &Path = path.into();
|
||||||
|
@ -46,7 +48,7 @@ fn real_main() -> i32 {
|
||||||
|
|
||||||
for file in files {
|
for file in files {
|
||||||
append_zip
|
append_zip
|
||||||
.start_file_from_path(file, Default::default())
|
.start_file(file.to_string_lossy(), SimpleFileOptions::default())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut f = File::open(file).unwrap();
|
let mut f = File::open(file).unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue