From 574e897610889ae4d10b136ad8b46c7e6a8c063b Mon Sep 17 00:00:00 2001 From: Andrej Date: Sun, 3 Aug 2025 18:49:38 -0400 Subject: [PATCH] cargo fmt pass --- daemon/src/display/uz801.rs | 10 ++++++---- installer/src/uz801.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/daemon/src/display/uz801.rs b/daemon/src/display/uz801.rs index b4b30c9..ea0fd7e 100644 --- a/daemon/src/display/uz801.rs +++ b/daemon/src/display/uz801.rs @@ -54,11 +54,13 @@ pub fn update_ui( Err(mpsc::error::TryRecvError::Empty) => {} Err(e) => error!("error receiving ui update message: {e}"), }; - + // Update LEDs if state changed or if 5 seconds have passed since last update let now = std::time::Instant::now(); - let should_update = !invisible && (state != last_state || now.duration_since(last_update) >= Duration::from_secs(5)); - + let should_update = !invisible + && (state != last_state + || now.duration_since(last_update) >= Duration::from_secs(5)); + if should_update { match state { DisplayState::Paused => { @@ -80,7 +82,7 @@ pub fn update_ui( last_state = state; last_update = now; } - + tokio::time::sleep(Duration::from_secs(1)).await; } }); diff --git a/installer/src/uz801.rs b/installer/src/uz801.rs index 5852ccb..f594071 100644 --- a/installer/src/uz801.rs +++ b/installer/src/uz801.rs @@ -1,3 +1,4 @@ +use std::io::Write; /// Installer for the Uz801 hotspot. /// /// Installation process: @@ -6,7 +7,6 @@ /// 3. Use ADB to install rayhunter files /// 4. Modify startup script to launch rayhunter on boot use std::time::Duration; -use std::io::Write; use adb_client::{ADBDeviceExt, ADBUSBDevice, RustADBError}; use anyhow::Result;