File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -190,8 +190,7 @@ impl Level {
190190 quality
191191 . try_into ( )
192192 . unwrap_or ( 0 )
193- . max ( fastest. level ( ) )
194- . min ( best. level ( ) ) ,
193+ . clamp ( fastest. level ( ) , best. level ( ) )
195194 ) ,
196195 Self :: Default => bzip2:: Compression :: default ( ) ,
197196 }
@@ -209,8 +208,7 @@ impl Level {
209208 quality
210209 . try_into ( )
211210 . unwrap_or ( 0 )
212- . max ( fastest. level ( ) )
213- . min ( best. level ( ) ) ,
211+ . clamp ( fastest. level ( ) , best. level ( ) )
214212 ) ,
215213 Self :: Default => flate2:: Compression :: default ( ) ,
216214 }
@@ -222,7 +220,7 @@ impl Level {
222220 match self {
223221 Self :: Fastest => fastest,
224222 Self :: Best => best,
225- Self :: Precise ( quality) => quality. max ( fastest) . min ( best) ,
223+ Self :: Precise ( quality) => quality. clamp ( fastest, best) ,
226224 Self :: Default => libzstd:: DEFAULT_COMPRESSION_LEVEL ,
227225 }
228226 }
You can’t perform that action at this time.
0 commit comments