mirror of
https://github.com/RussellChamp/advent-of-code-2025-cursor.git
synced 2026-10-28 08:02:33 +00:00
Fix clippy warning: collapse nested if in Day 4
This commit is contained in:
1 parent
cf3a3f8bfe
commit
d3bc3493ee
1 file changed
+4
-4
+4
-4
@@ -41,10 +41,10 @@ fn count_neighbors(grid: &[Vec<Cell>], row: usize, col: usize) -> usize {
|
||||
}
|
||||
let nr = row as i32 + dr;
|
||||
let nc = col as i32 + dc;
|
||||
if nr >= 0 && nr < rows && nc >= 0 && nc < cols {
|
||||
if grid[nr as usize][nc as usize].is_paper() {
|
||||
count += 1;
|
||||
}
|
||||
if nr >= 0 && nr < rows && nc >= 0 && nc < cols
|
||||
&& grid[nr as usize][nc as usize].is_paper()
|
||||
{
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user