Skip to content

Commit

Permalink
extract level to a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Mar 19, 2023
1 parent 83271f0 commit 499e2ea
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ pub fn run(
None => return Ok(()),
};

let level = if fast {
Some(0) // Lowest level of compression
} else if slow {
Some(i16::MAX) // Highest level of compression
} else {
level
};

let compress_result = compress_files(
files,
formats,
Expand All @@ -83,13 +91,7 @@ pub fn run(
args.quiet,
question_policy,
file_visibility_policy,
if fast {
Some(0)
} else if slow {
Some(i16::MAX)
} else {
level
},
level,
);

if let Ok(true) = compress_result {
Expand Down

0 comments on commit 499e2ea

Please sign in to comment.