diff --git a/agb/examples/panic.rs b/agb/examples/panic.rs index 71ff6e8c..a02e857f 100644 --- a/agb/examples/panic.rs +++ b/agb/examples/panic.rs @@ -16,7 +16,7 @@ fn main(mut gba: agb::Gba) -> ! { } if input.is_just_pressed(agb::input::Button::B) { #[allow(arithmetic_overflow)] - let _p = core::i32::MAX + 1; + let _p = i32::MAX + 1; } } } diff --git a/examples/the-dungeon-puzzlers-lament/src/game/game_state.rs b/examples/the-dungeon-puzzlers-lament/src/game/game_state.rs index cf5f44e6..75774fca 100644 --- a/examples/the-dungeon-puzzlers-lament/src/game/game_state.rs +++ b/examples/the-dungeon-puzzlers-lament/src/game/game_state.rs @@ -390,8 +390,7 @@ impl CursorState { let mut new_x = current_x.saturating_add_signed(lr as isize).max(1); let new_y = current_y .saturating_add_signed(ud as isize) - .max(1) - .min(PLAY_AREA_HEIGHT - 2); + .clamp(1, PLAY_AREA_HEIGHT - 2); if new_x == PLAY_AREA_WIDTH - 1 { new_x = new_x.min(PLAY_AREA_WIDTH - 2);