fixed some clippy warns

This commit is contained in:
2025-06-19 18:50:57 +01:00
parent a48dfee777
commit 5c83b49328
5 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -233,8 +233,8 @@ pub struct PersistentState {
impl PersistentState {
pub fn update(&mut self, new_state: &Self) {
self.history.extend(new_state.history.clone());
if self.history.len() > 32768 {
let len = self.history.len() - 32768;
if self.history.len() > 1024 {
let len = self.history.len() - 1024;
self.history.drain(..len);
}
}
@@ -254,7 +254,7 @@ impl Executable for Instruction {
// To populate the lower 16 bits, see LLI.
Self::LoadUpperImmediate(a) => {
*cpu.reg(a.r1) =
(cpu.get(a.r1) & 0x0000_FFFF) | u32::from(a.immediate) << 16;
(cpu.get(a.r1) & 0x0000_FFFF) | (u32::from(a.immediate) << 16);
}
// Unconditionally jumps to the calculated address or direct address
+1 -1
View File
@@ -128,7 +128,7 @@ impl Component for MemoryInspector {
// combine all 4 bytes in the chunk into a u32
let combined = chunk
.iter()
.fold(0u32, |acc, &byte| acc << 8 | u32::from(byte));
.fold(0u32, |acc, &byte| (acc << 8) | u32::from(byte));
ui.monospace(format!("{combined}"));
ui.monospace(format!("{}", Instruction::decode(combined).unwrap_or(Instruction::Nop)));