cargo fmt

This commit is contained in:
2025-06-15 03:10:18 +01:00
parent 17fed069c5
commit a16f57c737
6 changed files with 27 additions and 18 deletions
+7 -2
View File
@@ -1,6 +1,9 @@
use std::{num::ParseIntError, sync::mpsc::Sender}; use std::{num::ParseIntError, sync::mpsc::Sender};
use crate::emulator::{system::model::{Command, State}, ui::interface::Component}; use crate::emulator::{
system::model::{Command, State},
ui::interface::Component,
};
pub struct MemoryInspector { pub struct MemoryInspector {
view_size: u32, view_size: u32,
@@ -63,7 +66,9 @@ impl Component for MemoryInspector {
if search_clicked || enter_pressed { if search_clicked || enter_pressed {
if let Ok(new) = parse_address(&self.addr_input) { if let Ok(new) = parse_address(&self.addr_input) {
self.view_addr = new; self.view_addr = new;
self.sender.send(Command::Read(new, self.view_size)).unwrap(); self.sender
.send(Command::Read(new, self.view_size))
.unwrap();
} else { } else {
state.error = Some("Invalid address".to_string()); state.error = Some("Invalid address".to_string());
} }
+1 -1
View File
@@ -1,5 +1,5 @@
pub mod control_unit; pub mod control_unit;
pub mod interface; pub mod interface;
pub mod menu;
pub mod memory_inspector; pub mod memory_inspector;
pub mod menu;
pub mod stack_inspector; pub mod stack_inspector;
+9 -8
View File
@@ -1,14 +1,18 @@
use crate::{common::instructions::Register, emulator::{system::model::State, ui::interface::{Component, EmulatorUI}}}; use crate::{
common::instructions::Register,
emulator::{
system::model::State,
ui::interface::{Component, EmulatorUI},
},
};
pub struct StackInspector { pub struct StackInspector {
visible: bool visible: bool,
} }
impl StackInspector { impl StackInspector {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self { visible: false }
visible: false
}
} }
} }
@@ -60,6 +64,3 @@ impl Component for StackInspector {
}); });
} }
} }
+4 -1
View File
@@ -5,7 +5,10 @@ use std::{
use dsa_rs::emulator::{ use dsa_rs::emulator::{
system::{emulator::run_emulator, memory::MainStore, processor::Processor}, system::{emulator::run_emulator, memory::MainStore, processor::Processor},
ui::{control_unit::ControlPanel, interface::EmulatorUI, memory_inspector::MemoryInspector, stack_inspector::StackInspector}, ui::{
control_unit::ControlPanel, interface::EmulatorUI, memory_inspector::MemoryInspector,
stack_inspector::StackInspector,
},
}; };
fn main() -> Result<(), eframe::Error> { fn main() -> Result<(), eframe::Error> {