Skip to content

Commit

Permalink
test: replace .min().max() with clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
khoover committed Oct 14, 2024
1 parent 619c188 commit ada73d8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/local/room_coordinate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ mod test {
for rhs in i8::MIN..=i8::MAX {
assert_eq!(
coord.saturating_add(rhs).u8(),
(coord_inner as i16 + rhs as i16)
.max(0)
.min(ROOM_SIZE as i16 - 1) as u8
(coord_inner as i16 + rhs as i16).clamp(0, ROOM_SIZE as i16 - 1) as u8
)
}
}
Expand Down

0 comments on commit ada73d8

Please sign in to comment.