diff --git a/crates/alkane-gui/src/model.rs b/crates/alkane-gui/src/model.rs index 9691d8f5..a87f9052 100644 --- a/crates/alkane-gui/src/model.rs +++ b/crates/alkane-gui/src/model.rs @@ -697,8 +697,8 @@ impl MinerRow { // status with no PSU and no hashboards attached (issue #39: a bare S17 // control board showed a green PSU), so is_mining counts only when the // miner is actually hashing (hashrate, or at least one healthy board). - let actually_hashing = self.hashrate_ths > 0.0 - || self.board_status.iter().any(|b| *b == BoardHealth::Ok); + let actually_hashing = + self.hashrate_ths > 0.0 || self.board_status.contains(&BoardHealth::Ok); let delivering = self.power_w > 0.0 || self.psu_fan_rpm > 0.0 || self.psu_out_voltage_v.is_some() diff --git a/crates/alkane-gui/src/scan.rs b/crates/alkane-gui/src/scan.rs index fb690534..c4e06f5e 100644 --- a/crates/alkane-gui/src/scan.rs +++ b/crates/alkane-gui/src/scan.rs @@ -722,7 +722,10 @@ mod board_health_tests { assert_eq!(board_health(Some(true), None, false), BoardHealth::Ok); assert_eq!(board_health(None, Some(63), false), BoardHealth::Ok); // Present but idle / zero working chips -> fault (red). - assert_eq!(board_health(Some(false), Some(63), false), BoardHealth::Fault); + assert_eq!( + board_health(Some(false), Some(63), false), + BoardHealth::Fault + ); assert_eq!(board_health(None, Some(0), false), BoardHealth::Fault); } } diff --git a/crates/alkane-gui/src/ui.rs b/crates/alkane-gui/src/ui.rs index d9d46561..89543edc 100644 --- a/crates/alkane-gui/src/ui.rs +++ b/crates/alkane-gui/src/ui.rs @@ -2901,13 +2901,13 @@ impl App { let repo_row = Widget::box_sizer(false); let repo_input = Widget::text_ctrl(dlg, false); repo_input.set_value("blueflare/alkane-os"); - repo_row.add(repo_input, 1, sf::ALIGN_CENTRE_VERTICAL | sf::BORDER_RIGHT, 6); repo_row.add( - Widget::button(dlg, "Reload", ID_INSTALL_RELOAD), - 0, - 0, - 0, + repo_input, + 1, + sf::ALIGN_CENTRE_VERTICAL | sf::BORDER_RIGHT, + 6, ); + repo_row.add(Widget::button(dlg, "Reload", ID_INSTALL_RELOAD), 0, 0, 0); self.install_repo_input = repo_input; root.add_sizer( repo_row, @@ -4526,7 +4526,10 @@ impl App { self.progress.show(false); self.table_parent.layout(); crate::logs::log(format!("scan complete: {} miner(s) found", self.rows.len())); - Self::tick_installed_awaiting(&mut self.installed_awaiting, &mut self.op_status); + Self::tick_installed_awaiting( + &mut self.installed_awaiting, + &mut self.op_status, + ); // Arm the next automatic scan (if the loop is running). While // boards are still being verified as alkane, re-probe soon // instead of waiting the full interval. @@ -4622,7 +4625,11 @@ impl App { /// (log cleared) reset. Cheap no-op when nothing changed. fn refresh_log_view(&mut self) { let text = crate::logs::dump(); - let total = if text.is_empty() { 0 } else { text.lines().count() }; + let total = if text.is_empty() { + 0 + } else { + text.lines().count() + }; if total > self.log_shown_len { let new: String = text .lines() @@ -6198,9 +6205,10 @@ impl App { ID_INSTALL_OK => self.apply_install_confirm(), ID_INSTALL_RELOAD => self.reload_install_repo(), ID_INSTALL_BROWSE => { - if let Some(path) = - Widget::file_dialog(self.install_dialog, "Choose a local .afw to install") - { + if let Some(path) = Widget::file_dialog( + self.install_dialog, + "Choose a local .afw to install", + ) { let name = std::path::Path::new(&path) .file_name() .map(|n| n.to_string_lossy().into_owned())