From 869aa5b859573df8bf763767b77deb3e3b5d3538 Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 6 Aug 2024 00:08:08 +0100 Subject: [PATCH] Lower MSRV --- Cargo.toml | 4 ++-- src/kmeans.rs | 2 +- src/quant.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3ed15f2..71661fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "imagequant" -version = "4.3.2" +version = "4.3.3" description = "Convert 24/32-bit images to 8-bit palette with alpha channel.\nFor lossy PNG compression and high-quality GIF images\nDual-licensed like pngquant. See https://pngquant.org for details." authors = ["Kornel Lesiński "] license = "GPL-3.0-or-later" @@ -38,7 +38,7 @@ thread_local = { version = "1.1.8", optional = true } once_cell = "1.19.0" [dev-dependencies] -lodepng = "3.10.4" +lodepng = "3.10" [workspace] members = ["imagequant-sys", "imagequant-sys/c_test"] diff --git a/src/kmeans.rs b/src/kmeans.rs index 04b341a..fa4c717 100644 --- a/src/kmeans.rs +++ b/src/kmeans.rs @@ -133,7 +133,7 @@ fn replace_unused_colors(palette: &mut PalF, hist: &HistogramInternal) -> Result let colors = palette.as_slice(); // the search is just for diff, ignoring adjusted_weight, // because the palette already optimizes for the max weight, so it'd likely find another redundant entry. - for item in &hist.items { + for item in hist.items.iter() { // the early reject avoids running full palette search for every entry let may_be_worst = colors.get(item.likely_palette_index() as usize) .map_or(true, |pal| pal.diff(&item.color) > worst_diff); diff --git a/src/quant.rs b/src/quant.rs index 1d3ab26..bf5c199 100644 --- a/src/quant.rs +++ b/src/quant.rs @@ -441,7 +441,7 @@ fn refine_palette(palette: &mut PalF, attr: &Attributes, hist: &mut HistogramInt #[cold] fn palette_from_histogram(hist: &HistogramInternal, max_colors: PalLen) -> (PalF, Option) { let mut hist_pal = PalF::new(); - for item in &hist.items { + for item in hist.items.iter() { hist_pal.push(item.color, PalPop::new(item.perceptual_weight)); }