Fix compilation

This commit is contained in:
Josh Holmer 2023-07-07 21:09:10 -04:00
parent 2c7f0a8f48
commit dcf7d2115f
2 changed files with 4 additions and 4 deletions

View file

@ -113,7 +113,7 @@ impl Deflater for BufferedZopfliDeflater {
Ok(out.into_inner())
})();
let out = out.map_err(|e| PngError::new(&e.to_string()))?;
if max_size.get().is_some_and(|max| max < out.len()) {
if max_size.get().map(|max| max < out.len()).unwrap_or(false) {
Err(PngError::DeflatedDataTooLong(out.len()))
} else {
Ok(out)

View file

@ -592,8 +592,8 @@ fn optimize_png(
raw.clone(),
&opts,
deadline.clone(),
max_siz,
&opts.deflatee,
max_size,
&opts.deflate,
) {
png.raw = new_png.raw;
png.idat_data = new_png.idat_data;
@ -867,7 +867,7 @@ fn report_format(prefix: &str, png: &PngImage) {
}
/// Perform cleanup of certain chunks from the `PngData` object, after optimization has been completed
fn postprocess_chunks(
fn postprocess_chunks<T>(
png: &mut PngData,
opts: &Options,
deadline: Arc<Deadline>,