Clippy - example 7
@@ -154,8 +154,7 @@ impl GameState for State {
// Iterate the map array, incrementing coordinates as we go.
let mut y = 0;
let mut x = 0;
- let mut i: usize = 0;
- for tile in self.map.iter() {
+ for (i,tile) in self.map.iter().enumerate() {
// Render a tile depending upon the tile type; now we check visibility as well!
let mut fg = RGB::from_f32(1.0, 1.0, 1.0);
let glyph: u8;
@@ -185,7 +184,6 @@ impl GameState for State {
x = 0;
y += 1;
}
- i += 1;
}
// Render the player @ symbol
