Skip to content

Commit

Permalink
Change Zip FileOptions to SimpleFileOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
okynos committed Apr 30, 2024
1 parent 6065c5f commit 7ed91ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rotator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ use crate::utils;
// Compress given file into zip.
#[cfg(windows)]
fn compress_zip_file(filepath: &str) -> Result<String, String> {
use zip::write::FileOptions;
use zip::write::SimpleFileOptions;
use std::io::{BufReader, BufRead};
let filename = Path::new(filepath).file_name().unwrap().to_str().unwrap();
let zipfilename = format!("{}.zip", filepath);
let path = Path::new(&zipfilename);
let zipfile = File::create(path).unwrap();

let mut zip = zip::ZipWriter::new(zipfile);
match zip.start_file(filename, FileOptions::default()){
match zip.start_file(filename, SimpleFileOptions::default()){
Ok(_v) => {
let file = File::open(filepath).unwrap();
let reader = BufReader::new(file);
Expand Down

0 comments on commit 7ed91ea

Please sign in to comment.