Skip to content

Commit b5e5674

Browse files
committed
perf: remove format calls from map getter
1 parent 8a32a9f commit b5e5674

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/2024/days/map2d.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ impl<T> Map2D<T> {
3131
if self.is_out_of_bounds(p) {
3232
None
3333
} else {
34-
let v = &self.map[usize::try_from(p.y).expect(format!("y {p:?}").as_str())]
35-
[usize::try_from(p.x).expect(format!("x {p:?}").as_str())];
34+
let v = &self.map[usize::try_from(p.y).unwrap()][usize::try_from(p.x).unwrap()];
3635
Some(v)
3736
}
3837
}

0 commit comments

Comments
 (0)