From 1532c45342ef2c078ff72d5e732f895fa1c8a7ae Mon Sep 17 00:00:00 2001 From: xzeldon Date: Fri, 6 Sep 2024 04:09:54 +0300 Subject: [PATCH] refactor: imports --- src/tray.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tray.rs b/src/tray.rs index 507d3f2..d9275b2 100644 --- a/src/tray.rs +++ b/src/tray.rs @@ -3,6 +3,7 @@ use std::{ rc::Rc, sync::{mpsc, Arc, Mutex}, thread, + time::{Duration, Instant}, }; use crate::manager::DeviceManager; @@ -17,7 +18,7 @@ use winapi::um::{ winuser::{self, ShowWindow, SW_SHOW}, }; -const BATTERY_UPDATE_INTERVAL: Duration = Duration::from_secs(60); +const BATTERY_UPDATE_INTERVAL: Duration = Duration::from_secs(5); const DEVICE_FETCH_INTERVAL: Duration = Duration::from_secs(5); #[derive(Debug)] @@ -195,7 +196,7 @@ impl TrayApp { event_loop.run(move |event, _, control_flow| { *control_flow = tao::event_loop::ControlFlow::WaitUntil( - std::time::Instant::now() + std::time::Duration::from_millis(100), + Instant::now() + Duration::from_millis(100), ); if let Ok(device_ids) = rx.try_recv() {