diff --git a/src/frontpanel.rs b/src/frontpanel.rs index ad5ec5e..9341a38 100644 --- a/src/frontpanel.rs +++ b/src/frontpanel.rs @@ -162,9 +162,10 @@ impl Widget for &mut Frontpanel<'_> { )) .changed() { - self.state.ad_sws = - (self.state.ad_sws & !(bit_mask)) | (u16::from(sw_state) << (16 - i)); - self.interaction = Some(FrontpanelInteraction::AddrData(self.state.ad_sws())); + self.state.ad_sws = (self.state.ad_sws & !(bit_mask)) + | (u16::from(sw_state) << (16 - i)); + self.interaction = + Some(FrontpanelInteraction::AddrData(self.state.ad_sws())); resp.mark_changed(); }; }); diff --git a/src/frontpanel/switch.rs b/src/frontpanel/switch.rs index 1a8ee54..1bb3e6a 100644 --- a/src/frontpanel/switch.rs +++ b/src/frontpanel/switch.rs @@ -14,11 +14,7 @@ pub struct Textures { impl Textures { pub fn new(up: TextureHandle, neut: TextureHandle, down: TextureHandle) -> Self { - Self { - up, - neut, - down, - } + Self { up, neut, down } } pub fn get_for_state(&self, state: SwitchState) -> TextureId { diff --git a/src/main.rs b/src/main.rs index 1cbe1ac..f2e7211 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,7 +88,13 @@ impl AltairEmulator { ); ui.close_menu(); } - if ui.add_enabled(!self.windows.contains_key("load_bin"), Button::new("Load binary file")).clicked() { + if ui + .add_enabled( + !self.windows.contains_key("load_bin"), + Button::new("Load binary file"), + ) + .clicked() + { self.windows .insert("load_bin", Box::new(LoadBinWindow::new(ui.ctx()))); ui.close_menu(); diff --git a/src/state.rs b/src/state.rs index 5227a4b..318dd6c 100644 --- a/src/state.rs +++ b/src/state.rs @@ -114,7 +114,10 @@ impl EmuState { MemCycle::Fetch(a) | MemCycle::Read(a) | MemCycle::StackRead(a) => { self.fp_state.set_data(self.mem[a as usize]); } - MemCycle::Write(_, _) | MemCycle::StackWrite(_, _) | MemCycle::Out(_, _) | MemCycle::Hlta => { + MemCycle::Write(_, _) + | MemCycle::StackWrite(_, _) + | MemCycle::Out(_, _) + | MemCycle::Hlta => { self.fp_state.set_data(0xff); } MemCycle::In(_) => {