Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Slices test: as_chunks for the fixed 3-wide rows (clippy chunks_exact_to_as_chunks) (#1374)

Brandon Thomasdd555217ac12
diff --git a/crates/engine/src/slice_cmds/tests.rs b/crates/engine/src/slice_cmds/tests.rs
index 45373578f..70b50bc64 100644
--- a/crates/engine/src/slice_cmds/tests.rs
+++ b/crates/engine/src/slice_cmds/tests.rs
@@ -104,7 +104,7 @@ fn divide_wide_slice_preserves_exact_edges_and_history() {
let parts = &doc(&s).slices.list;
assert_eq!(parts.len(), 9);
assert_eq!(parts[0].name, "wide");
- for row in parts.chunks_exact(3) {
+ for row in parts.as_chunks::<3>().0 {
assert_eq!(row[0].rect.x0, rect.x0);
assert_eq!(row[2].rect.x1, rect.x1);
assert_eq!(row.iter().map(|s| u64::from(s.rect.width())).sum::<u64>(), u64::from(rect.width()));