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
+8 -3
View File
@@ -1,6 +1,9 @@
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 {
view_size: u32,
@@ -36,7 +39,7 @@ impl Component for MemoryInspector {
}
fn render(&mut self, state: &mut State, ui: &mut egui::Ui, ctx: &egui::Context) {
// Right column - Memory
// Right column - Memory
ui.vertical(|ui| {
ui.heading("Memory Inspector");
ui.add_space(10.0);
@@ -63,7 +66,9 @@ impl Component for MemoryInspector {
if search_clicked || enter_pressed {
if let Ok(new) = parse_address(&self.addr_input) {
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 {
state.error = Some("Invalid address".to_string());
}
+1 -1
View File
@@ -1,5 +1,5 @@
pub mod control_unit;
pub mod interface;
pub mod menu;
pub mod memory_inspector;
pub mod menu;
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 {
visible: bool
visible: bool,
}
impl StackInspector {
pub fn new() -> Self {
Self {
visible: false
}
Self { visible: false }
}
}
@@ -60,6 +64,3 @@ impl Component for StackInspector {
});
}
}
+4 -1
View File
@@ -5,7 +5,10 @@ use std::{
use dsa_rs::emulator::{
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> {