Skip to content

Commit 15d4aab

Browse files
committed
Return usize from width() and height()
1 parent e461dd2 commit 15d4aab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

day20/src/day20.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ impl Skip {
6262
}
6363

6464
impl Racetrack {
65-
fn height(&self) -> i32 {
66-
self.rows.len() as i32
65+
fn height(&self) -> usize {
66+
self.rows.len()
6767
}
6868

69-
fn width(&self) -> i32 {
70-
self.rows[0].len() as i32
69+
fn width(&self) -> usize {
70+
self.rows[0].len()
7171
}
7272

7373
fn in_bounds(&self, pos: Vec2<i32>) -> bool {
74-
pos.x >= 0 && pos.x < self.width() && pos.y >= 0 && pos.y < self.height()
74+
pos.x >= 0 && pos.x < self.width() as i32 && pos.y >= 0 && pos.y < self.height() as i32
7575
}
7676

7777
fn neighbors<'a>(&'a self, pos: Vec2<i32>) -> impl Iterator<Item = Vec2<i32>> + 'a {

0 commit comments

Comments
 (0)