range refactor, clippy

This commit is contained in:
Vinzenz Schroeter 2025-07-08 20:01:39 +02:00
commit 0bf317dd6d
6 changed files with 35 additions and 57 deletions

View file

@ -42,7 +42,7 @@ impl Game {
Row::new(
5usize.pow(index as u32) as f64,
1.0 * (0.5f64.powi(index as i32)),
*name,
name,
)
})
.collect();
@ -104,13 +104,11 @@ impl Game {
let (mut text_layer, mut pixel_layer) =
draw_border_panel(text_layer, pixel_layer, " Processes ", INNER_BORDER);
for (index, row) in self.state.rows.iter().enumerate() {
let bar_window = pixel_layer
.window_mut(0, index * TILE_SIZE, pixel_layer.width(), TILE_SIZE)
.unwrap();
let label_window = text_layer
.window_mut(0, index, text_layer.width(), 1)
.unwrap();
for row in self.state.rows.iter() {
let bar_window;
(bar_window, pixel_layer) = pixel_layer.split_vertical_mut(TILE_SIZE).unwrap();
let label_window;
(label_window, text_layer) = text_layer.split_vertical_mut(1).unwrap();
row.draw(label_window, bar_window);
}
}