1use crate::Coord;
2
3#[derive(Debug, Copy, Clone, Eq, PartialEq)]
5#[deprecated(since = "0.1.4", note = "Use `DynamicGrid` instead")]
6pub struct Rect {
7 min: Coord,
8 max: Coord,
9}
10
11impl Rect {
12 pub fn from_min_max(min: impl Into<Coord>, max: impl Into<Coord>) -> Self {
17 Self {
18 min: min.into(),
19 max: max.into(),
20 }
21 }
22
23 pub fn coords(self) -> impl Iterator<Item = Coord> {
25 (self.min.x..=self.max.x)
26 .flat_map(move |x| (self.min.y..=self.max.y).map(move |y| Coord::new(x, y)))
27 }
28}