style(simulation): gate bounce — fmt wrap + clippy needless_range_loop

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 14:24:45 +02:00
co-authored by Claude Fable 5
parent 39f0fd8c51
commit 4a9567c669
2 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -2188,7 +2188,9 @@ fn lake_from_hydrology_at(ta: &TerrainAnalysis, px: f64, py: f64) -> (bool, i32)
0
} else {
let depth = (filled - original).max(0.0);
((depth / basin_max_depth) * 100.0).round().clamp(0.0, 100.0) as i32
((depth / basin_max_depth) * 100.0)
.round()
.clamp(0.0, 100.0) as i32
}
} else {
0
+3 -3
View File
@@ -417,13 +417,13 @@ pub fn solve(
// built from — walked directly here rather than through `basins` to
// avoid a second clone of every basin's cell list.
let mut basin_max_depth_scaled = vec![0i64; n];
for b in 0..basin_count {
let max_depth = basin_cells[b]
for cells in basin_cells.iter().take(basin_count) {
let max_depth = cells
.iter()
.map(|&c| (filled[c] - original[c]).max(0))
.max()
.unwrap_or(0);
for &c in &basin_cells[b] {
for &c in cells {
basin_max_depth_scaled[c] = max_depth;
}
}