Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Clippy 1.99: as_chunks for the Fill spot's completion (chunks_exact_to_as_chunks)

JordyUSA3c50fd58e64a
diff --git a/crates/pipeline/src/spots.rs b/crates/pipeline/src/spots.rs
index 483f83f3c..f8b3fbbdf 100644
--- a/crates/pipeline/src/spots.rs
+++ b/crates/pipeline/src/spots.rs
@@ -247,8 +247,8 @@ fn fill_box(src: &mut [[f32; 3]], tgt: &[[f32; 3]], alpha: &[f32], bw: usize, bh
let flat: Vec<f32> = tgt.iter().flatten().copied().collect();
let out = lightcraft_inpaint::complete(bw, bh, 3, &flat, &hole, &lightcraft_inpaint::CompleteParams::default())
.unwrap_or_else(|| lightcraft_inpaint::membrane_fill(bw, bh, 3, &flat, &hole));
- for (d, v) in src.iter_mut().zip(out.chunks_exact(3)) {
- *d = [v[0], v[1], v[2]];
+ for (d, v) in src.iter_mut().zip(out.as_chunks::<3>().0) {
+ *d = *v;
}
}