Skip to content

Instantly share code, notes, and snippets.

@Nercury
Created August 18, 2016 12:43
Show Gist options
  • Save Nercury/d9e1b9293972452df6bbdac5badbe189 to your computer and use it in GitHub Desktop.
Save Nercury/d9e1b9293972452df6bbdac5badbe189 to your computer and use it in GitHub Desktop.
pub fn all_coords<'r>(&'r self) -> impl Iterator<Item=(usize, usize)> + 'r {
(0..self.items.len()).map(move |i: usize| (i % self.w, i / self.w))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment