We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e461dd2 commit 15d4aabCopy full SHA for 15d4aab
day20/src/day20.rs
@@ -62,16 +62,16 @@ impl Skip {
62
}
63
64
impl Racetrack {
65
- fn height(&self) -> i32 {
66
- self.rows.len() as i32
+ fn height(&self) -> usize {
+ self.rows.len()
67
68
69
- fn width(&self) -> i32 {
70
- self.rows[0].len() as i32
+ fn width(&self) -> usize {
+ self.rows[0].len()
71
72
73
fn in_bounds(&self, pos: Vec2<i32>) -> bool {
74
- pos.x >= 0 && pos.x < self.width() && pos.y >= 0 && pos.y < self.height()
+ pos.x >= 0 && pos.x < self.width() as i32 && pos.y >= 0 && pos.y < self.height() as i32
75
76
77
fn neighbors<'a>(&'a self, pos: Vec2<i32>) -> impl Iterator<Item = Vec2<i32>> + 'a {
0 commit comments