emulator: applied some clippy lints
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
use crate::{
|
||||
common::instructions::Register,
|
||||
emulator::{
|
||||
system::model::State,
|
||||
ui::interface::{Component, EmulatorUI},
|
||||
},
|
||||
emulator::{system::model::State, ui::interface::Component},
|
||||
};
|
||||
|
||||
pub struct StackInspector {
|
||||
visible: bool,
|
||||
}
|
||||
|
||||
impl Default for StackInspector {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl StackInspector {
|
||||
pub fn new() -> Self {
|
||||
#[must_use]
|
||||
pub const fn new() -> Self {
|
||||
Self { visible: false }
|
||||
}
|
||||
}
|
||||
@@ -29,7 +33,7 @@ impl Component for StackInspector {
|
||||
super::interface::Category::Memory
|
||||
}
|
||||
|
||||
fn render(&mut self, state: &mut State, ui: &mut egui::Ui, ctx: &egui::Context) {
|
||||
fn render(&mut self, state: &mut State, ui: &mut egui::Ui, _ctx: &egui::Context) {
|
||||
ui.vertical(|ui| {
|
||||
ui.heading("Stack Inspector");
|
||||
egui::ScrollArea::vertical()
|
||||
@@ -44,13 +48,13 @@ impl Component for StackInspector {
|
||||
ui.label("Value");
|
||||
ui.end_row();
|
||||
|
||||
for (i, value) in state.stack_view.iter().take(32).enumerate() {
|
||||
for (i, value) in (0u32..).zip(state.stack_view.iter().take(32)) {
|
||||
ui.label(format!(
|
||||
"{} [{}]",
|
||||
i,
|
||||
state.reg_file.get(Register::Spr) - i as u32 * 4
|
||||
state.reg_file.get(Register::Spr) - i * 4
|
||||
));
|
||||
ui.label(format!("0x{:08X} ({})", value, value));
|
||||
ui.label(format!("0x{value:08X} ({value})"));
|
||||
ui.end_row();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user