clippy code clean up

clippy code clean up
This commit is contained in:
2025-08-11 20:47:21 -07:00
parent 05276f9eea
commit c3f81eef25
5 changed files with 49 additions and 107 deletions
+2 -10
View File
@@ -1,24 +1,16 @@
//! Shared agent state: sysinfo handles and hot JSON cache.
use std::sync::atomic::AtomicUsize;
use std::{collections::HashMap, sync::Arc};
use sysinfo::{Components, Disks, Networks, System};
use std::sync::Arc;
use sysinfo::System;
use tokio::sync::{Mutex, Notify, RwLock};
pub type SharedSystem = Arc<Mutex<System>>;
pub type SharedNetworks = Arc<Mutex<Networks>>;
pub type SharedTotals = Arc<Mutex<HashMap<String, (u64, u64)>>>;
pub type SharedComponents = Arc<Mutex<Components>>;
pub type SharedDisks = Arc<Mutex<Disks>>;
#[derive(Clone)]
pub struct AppState {
// Persistent sysinfo handles
pub sys: SharedSystem,
pub nets: SharedNetworks,
pub net_totals: SharedTotals, // iface -> (rx_total, tx_total)
pub components: SharedComponents,
pub disks: SharedDisks,
// Last serialized JSON snapshot for fast WS responses
pub last_json: Arc<RwLock<String>>,