From 2d16819cbfdc76787d26767fac0a9f73153210a7 Mon Sep 17 00:00:00 2001 From: Nino Burini Date: Mon, 15 Nov 2021 17:17:52 +0100 Subject: [PATCH] apply_preset_5 and apply_preset_6 to set correct compression levels. (#425) The for loop in apply_preset_5 was not including 9. apply_preset_6 now builds now calls apply_preset_4 instead of apply_preset_5, and adds all compression levels from 1 to 9. Co-authored-by: Nino Burini --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a4620cef..3d8ff86a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -263,7 +263,7 @@ impl Options { fn apply_preset_5(mut self) -> Self { if let Deflaters::Zlib { compression, .. } = &mut self.deflate { compression.clear(); - for i in 3..9 { + for i in 3..10 { compression.insert(i); } } @@ -273,11 +273,11 @@ impl Options { fn apply_preset_6(mut self) -> Self { if let Deflaters::Zlib { compression, .. } = &mut self.deflate { compression.clear(); - for i in 1..3 { + for i in 1..10 { compression.insert(i); } } - self.apply_preset_5() + self.apply_preset_4() } }