You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-11-30 09:08:45 +02:00
More minor fixes (#1561)
- Fix compile errors and warnings in error handling example - Tweak iteration example so that it correctly visits the first grid coordinate
This commit is contained in:
@@ -34,7 +34,6 @@ impl Iterator for GridIter {
|
||||
type Item = (u32, u32);
|
||||
|
||||
fn next(&mut self) -> Option<(u32, u32)> {
|
||||
self.i += 1;
|
||||
if self.i >= self.grid.x_coords.len() {
|
||||
self.i = 0;
|
||||
self.j += 1;
|
||||
@@ -42,7 +41,9 @@ impl Iterator for GridIter {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
Some((self.grid.x_coords[self.i], self.grid.y_coords[self.j]))
|
||||
let res = Some((self.grid.x_coords[self.i], self.grid.y_coords[self.j]));
|
||||
self.i += 1;
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user