I have a grid I've represented as a Vec<Vec<usize>>. I know that the length of all inner vectors is the same. Disregarding panics for now, is there a concise way to express an iterator through each element in the grid?
e.g. I want this:
(0..self.width())
.flat_map(|x| {
(0..self.height())
.map(move |y| (x, y))
})
.for_each(move |(x, y)| {
// do stuff
});
But ideally as some more simple one-liner, like:
for (x, y) in /* something */ {
}