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 <nburini@jabra.com>
This commit is contained in:
Nino Burini 2021-11-15 17:17:52 +01:00 committed by GitHub
parent 8053211bf4
commit 2d16819cbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -263,7 +263,7 @@ impl Options {
fn apply_preset_5(mut self) -> Self { fn apply_preset_5(mut self) -> Self {
if let Deflaters::Zlib { compression, .. } = &mut self.deflate { if let Deflaters::Zlib { compression, .. } = &mut self.deflate {
compression.clear(); compression.clear();
for i in 3..9 { for i in 3..10 {
compression.insert(i); compression.insert(i);
} }
} }
@ -273,11 +273,11 @@ impl Options {
fn apply_preset_6(mut self) -> Self { fn apply_preset_6(mut self) -> Self {
if let Deflaters::Zlib { compression, .. } = &mut self.deflate { if let Deflaters::Zlib { compression, .. } = &mut self.deflate {
compression.clear(); compression.clear();
for i in 1..3 { for i in 1..10 {
compression.insert(i); compression.insert(i);
} }
} }
self.apply_preset_5() self.apply_preset_4()
} }
} }