Fix clippy lints (#611)

This commit is contained in:
Corwin 2024-04-06 02:53:25 +01:00 committed by GitHub
commit 6704b96fda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -16,7 +16,7 @@ fn main(mut gba: agb::Gba) -> ! {
} }
if input.is_just_pressed(agb::input::Button::B) { if input.is_just_pressed(agb::input::Button::B) {
#[allow(arithmetic_overflow)] #[allow(arithmetic_overflow)]
let _p = core::i32::MAX + 1; let _p = i32::MAX + 1;
} }
} }
} }

View file

@ -390,8 +390,7 @@ impl CursorState {
let mut new_x = current_x.saturating_add_signed(lr as isize).max(1); let mut new_x = current_x.saturating_add_signed(lr as isize).max(1);
let new_y = current_y let new_y = current_y
.saturating_add_signed(ud as isize) .saturating_add_signed(ud as isize)
.max(1) .clamp(1, PLAY_AREA_HEIGHT - 2);
.min(PLAY_AREA_HEIGHT - 2);
if new_x == PLAY_AREA_WIDTH - 1 { if new_x == PLAY_AREA_WIDTH - 1 {
new_x = new_x.min(PLAY_AREA_WIDTH - 2); new_x = new_x.min(PLAY_AREA_WIDTH - 2);