cpu.rs, tests.rs: fix clippy lints (thanks clippy)

This commit is contained in:
John 2023-08-31 22:40:30 -05:00
parent 8de4f42ff6
commit 7ab0a596c9
2 changed files with 10 additions and 8 deletions

View File

@ -539,6 +539,7 @@ impl CPU {
/// ```
pub fn dump(&self) {
//let dumpstyle = owo_colors::Style::new().bright_black();
use std::fmt::Write;
std::println!(
"PC: {:04x}, SP: {:04x}, I: {:04x}\n{}DLY: {}, SND: {}, CYC: {:6}",
self.pc,
@ -547,16 +548,17 @@ impl CPU {
self.v
.into_iter()
.enumerate()
.map(|(i, gpr)| {
format!(
"v{i:X}: {gpr:02x} {}",
.fold(String::new(), |mut s, (i, gpr)| {
let _ = write!(
s,
"{}v{i:X}: {gpr:02x}",
match i % 4 {
3 => "\n",
0 => "\n",
_ => "",
}
)
})
.collect::<String>(),
);
s
}),
self.delay,
self.sound,
self.cycle,

View File

@ -956,7 +956,7 @@ mod io {
}
mod bcdtest {
pub(self) use super::*;
use super::*;
struct BCDTest {
// value to test