Skip to content

Commit

Permalink
upgrade zip lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mothsART committed Aug 30, 2024
1 parent 534abb4 commit ffa7753
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/target
Sample.md
data

tests/datasets/machmap/rusted_chain.odt
tests/datasets/mapreduce/result.zip
147 changes: 116 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ tiny-skia="0.11"
image = { version="0.25" }
markdown = "0.3"
colored = "2"
zip = "0.6"
zip = "2"
tempfile = "3.3"
svg-hush = "0.9"
serde = "1.0"
serde = "1"
serde_json = { version = "1.0", features = ["preserve_order"] }
serde_yaml = "0.9"
tera = "1.17"
Expand Down
6 changes: 4 additions & 2 deletions src/machmap/jpg/jpgtoodt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::error::Error;

use zip::write::SimpleFileOptions;

use crate::machmap::InputTo;

pub struct JpgToOdt<'a> {
Expand Down Expand Up @@ -28,8 +30,8 @@ impl<'a> InputTo<'a> for JpgToOdt<'a> {
let path = std::path::Path::new(&self.output_file);
let file = std::fs::File::create(path).unwrap();
let mut zip = zip::ZipWriter::new(file);
let options =
zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Stored);

let options = SimpleFileOptions::default();

let tera = Tera::new("templates/odt/**/*")?;
let mut context = Context::new();
Expand Down
4 changes: 2 additions & 2 deletions src/machreduce/zip_reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::io::Write;
use std::path::Path;

use colored::*;
use zip::write::SimpleFileOptions;

use crate::machreduce::{Direction, InputTo};

Expand All @@ -29,8 +30,7 @@ impl<'a> InputTo<'a> for ZipOutputFile<'a> {
let path = std::path::Path::new(&self.output_file);
let file = std::fs::File::create(path).unwrap();
let mut zip = zip::ZipWriter::new(file);
let options =
zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Stored);
let options = SimpleFileOptions::default();

for line in self.input_lines {
let mut buffer = Vec::new();
Expand Down
Binary file removed tests/datasets/machmap/rusted_chain.odt
Binary file not shown.
Binary file removed tests/datasets/mapreduce/result.zip
Binary file not shown.

0 comments on commit ffa7753

Please sign in to comment.