From a14e2b901f373ad53a893395f12d0b72d44a70d8 Mon Sep 17 00:00:00 2001 From: Jujstme Date: Mon, 25 Dec 2023 18:17:23 +0100 Subject: [PATCH] Fixing clippy suggestions --- src/emulator/sms/mod.rs | 7 ++++++- src/emulator/wii/mod.rs | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/emulator/sms/mod.rs b/src/emulator/sms/mod.rs index d3d40ef..22e66f0 100644 --- a/src/emulator/sms/mod.rs +++ b/src/emulator/sms/mod.rs @@ -1,6 +1,11 @@ //! Support for attaching to SEGA Master System / SEGA GameGear emulators. -use core::{cell::Cell, pin::Pin, future::Future, task::{Context, Poll}}; +use core::{ + cell::Cell, + future::Future, + pin::Pin, + task::{Context, Poll}, +}; use crate::{Address, Error, Process}; use bytemuck::CheckedBitPattern; diff --git a/src/emulator/wii/mod.rs b/src/emulator/wii/mod.rs index 1686934..8e166a8 100644 --- a/src/emulator/wii/mod.rs +++ b/src/emulator/wii/mod.rs @@ -113,9 +113,9 @@ impl Emulator { /// /// This call is meant to be used by experienced users. pub fn read_ignoring_endianness(&self, address: u32) -> Result { - if address >= 0x80000000 && address <= 0x817FFFFF { + if (0x80000000..0x81800000).contains(&address) { self.read_ignoring_endianness_from_mem_1(address) - } else if address >= 0x90000000 && address <= 0x93FFFFFF { + } else if (0x90000000..0x94000000).contains(&address) { self.read_ignoring_endianness_from_mem_2(address) } else { Err(Error {}) @@ -186,7 +186,7 @@ impl Emulator { &self, address: u32, ) -> Result { - if address < 0x80000000 || address > 0x817FFFFF { + if !(0x80000000..0x81800000).contains(&address) { return Err(Error {}); } @@ -211,7 +211,7 @@ impl Emulator { &self, address: u32, ) -> Result { - if address < 0x90000000 || address > 0x93FFFFFF { + if !(0x90000000..0x94000000).contains(&address) { return Err(Error {}); } let [_, mem2] = self.ram_base.get().ok_or(Error {})?;