Skip to content

Commit

Permalink
Fixing clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jujstme committed Dec 25, 2023
1 parent 488eeab commit e37fcd6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/emulator/sms/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/emulator/wii/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ impl Emulator {
///
/// This call is meant to be used by experienced users.
pub fn read_ignoring_endianness<T: CheckedBitPattern>(&self, address: u32) -> Result<T, Error> {
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 {})
Expand Down Expand Up @@ -186,7 +186,7 @@ impl Emulator {
&self,
address: u32,
) -> Result<T, Error> {
if address < 0x80000000 || address > 0x817FFFFF {
if !(0x80000000..0x81800000).contains(&address) {
return Err(Error {});
}

Expand All @@ -211,7 +211,7 @@ impl Emulator {
&self,
address: u32,
) -> Result<T, Error> {
if address < 0x90000000 || address > 0x93FFFFFF {
if !(0x90000000..0x94000000).contains(&address) {
return Err(Error {});
}
let [_, mem2] = self.ram_base.get().ok_or(Error {})?;
Expand Down

0 comments on commit e37fcd6

Please sign in to comment.