fix: replace deprecated functions

Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
ljedrz 2020-10-06 09:56:09 +02:00
parent ba9fc92229
commit 70b87d331f

View File

@ -102,7 +102,7 @@ impl ZipFile {
// Write file or directory // Write file or directory
if path.is_file() { if path.is_file() {
tracing::info!("Adding file {:?} as {:?}", path, name); tracing::info!("Adding file {:?} as {:?}", path, name);
zip.start_file_from_path(name, options)?; zip.start_file(name.to_string_lossy(), options)?;
let mut f = File::open(path)?; let mut f = File::open(path)?;
f.read_to_end(&mut buffer)?; f.read_to_end(&mut buffer)?;
@ -112,7 +112,7 @@ impl ZipFile {
// Only if not root Avoids path spec / warning // Only if not root Avoids path spec / warning
// and mapname conversion failed error on unzip // and mapname conversion failed error on unzip
tracing::info!("Adding directory {:?} as {:?}", path, name); tracing::info!("Adding directory {:?} as {:?}", path, name);
zip.add_directory_from_path(name, options)?; zip.add_directory(name.to_string_lossy(), options)?;
} }
} }