style(gui): rustfmt + clippy fixes for the review changes
source / check (pull_request) Skipped
verify / verify-windows (pull_request) Canceled after 0s
verify / verify (pull_request) Canceled after 44m33s

Apply cargo fmt to the edited gui sources and switch a board_status membership
check from iter().any() to contains() so `cargo fmt --check` and
`clippy -D warnings` (the verify CI gates) pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
This commit is contained in:
2026-11-13 12:15:41 -06:00
co-authored by Claude Opus 4.8
parent 69dcedbd9c
commit 25047a603a
3 changed files with 24 additions and 13 deletions
+2 -2
View File
@@ -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()
+4 -1
View File
@@ -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);
}
}
+18 -10
View File
@@ -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())