cpu.rs, tests.rs: fix clippy lints (thanks clippy)
This commit is contained in:
parent
8de4f42ff6
commit
7ab0a596c9
16
src/cpu.rs
16
src/cpu.rs
@ -539,6 +539,7 @@ impl CPU {
|
|||||||
/// ```
|
/// ```
|
||||||
pub fn dump(&self) {
|
pub fn dump(&self) {
|
||||||
//let dumpstyle = owo_colors::Style::new().bright_black();
|
//let dumpstyle = owo_colors::Style::new().bright_black();
|
||||||
|
use std::fmt::Write;
|
||||||
std::println!(
|
std::println!(
|
||||||
"PC: {:04x}, SP: {:04x}, I: {:04x}\n{}DLY: {}, SND: {}, CYC: {:6}",
|
"PC: {:04x}, SP: {:04x}, I: {:04x}\n{}DLY: {}, SND: {}, CYC: {:6}",
|
||||||
self.pc,
|
self.pc,
|
||||||
@ -547,16 +548,17 @@ impl CPU {
|
|||||||
self.v
|
self.v
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, gpr)| {
|
.fold(String::new(), |mut s, (i, gpr)| {
|
||||||
format!(
|
let _ = write!(
|
||||||
"v{i:X}: {gpr:02x} {}",
|
s,
|
||||||
|
"{}v{i:X}: {gpr:02x}",
|
||||||
match i % 4 {
|
match i % 4 {
|
||||||
3 => "\n",
|
0 => "\n",
|
||||||
_ => "",
|
_ => "",
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
})
|
s
|
||||||
.collect::<String>(),
|
}),
|
||||||
self.delay,
|
self.delay,
|
||||||
self.sound,
|
self.sound,
|
||||||
self.cycle,
|
self.cycle,
|
||||||
|
@ -956,7 +956,7 @@ mod io {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod bcdtest {
|
mod bcdtest {
|
||||||
pub(self) use super::*;
|
use super::*;
|
||||||
|
|
||||||
struct BCDTest {
|
struct BCDTest {
|
||||||
// value to test
|
// value to test
|
||||||
|
Loading…
Reference in New Issue
Block a user