Skip to content

Commit 0a4afc5

Browse files
committed
deepnsm: fix clippy needless_range_loop in gridlake_coca_wire
Convert the nested 0..256 index loops building the palette256² tables to iter_mut().enumerate(), clearing the -D clippy::needless-range-loop CI failure. Behavior is identical: cell = (a ^ b).wrapping_add(s * 37). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MLBnPuScZy6w9di2QEjsXM
1 parent b8f6bc6 commit 0a4afc5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

crates/deepnsm/examples/gridlake_coca_wire.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ fn main() {
4747

4848
let mut palette: Vec<[[u8; 256]; 256]> = vec![[[0u8; 256]; 256]; PQ];
4949
for (s, t) in palette.iter_mut().enumerate() {
50-
for a in 0..256 {
51-
for b in 0..256 {
52-
t[a][b] = ((a ^ b).wrapping_add(s * 37)) as u8;
50+
for (a, row) in t.iter_mut().enumerate() {
51+
for (b, cell) in row.iter_mut().enumerate() {
52+
*cell = ((a ^ b).wrapping_add(s * 37)) as u8;
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)