From 11506699e3c2fcd6169f2a2b0f152333b54b3b40 Mon Sep 17 00:00:00 2001 From: jasonwitty Date: Mon, 11 Aug 2025 22:44:43 -0700 Subject: [PATCH] clippy clean up --- socktop_agent/src/gpu.rs | 4 ++-- socktop_agent/src/main.rs | 2 +- socktop_agent/src/proto.rs | 6 +++--- socktop_agent/src/state.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/socktop_agent/src/gpu.rs b/socktop_agent/src/gpu.rs index 1916993..6e1e06d 100644 --- a/socktop_agent/src/gpu.rs +++ b/socktop_agent/src/gpu.rs @@ -6,7 +6,7 @@ pub struct GpuMetrics { pub name: String, pub utilization_gpu_pct: u32, // 0..100 pub mem_used_bytes: u64, - pub mem_total_bytes: u64 + pub mem_total_bytes: u64, } pub fn collect_all_gpus() -> Result, Box> { @@ -17,7 +17,7 @@ pub fn collect_all_gpus() -> Result, Box> name: gpu.model().to_string(), utilization_gpu_pct: info.load_pct() as u32, mem_used_bytes: info.used_vram(), - mem_total_bytes: info.total_vram() + mem_total_bytes: info.total_vram(), }; Ok(vec![metrics]) diff --git a/socktop_agent/src/main.rs b/socktop_agent/src/main.rs index 5fa46cc..1366cd3 100644 --- a/socktop_agent/src/main.rs +++ b/socktop_agent/src/main.rs @@ -62,7 +62,7 @@ async fn main() { wake_sampler: Arc::new(Notify::new()), auth_token: std::env::var("SOCKTOP_TOKEN") .ok() - .filter(|s| !s.is_empty()) + .filter(|s| !s.is_empty()), }; // Start background sampler (adjust cadence as needed) diff --git a/socktop_agent/src/proto.rs b/socktop_agent/src/proto.rs index 459cbfb..3ff466f 100644 --- a/socktop_agent/src/proto.rs +++ b/socktop_agent/src/proto.rs @@ -13,13 +13,13 @@ pub struct Metrics { pub swap_total_mb: u64, pub swap_used_mb: u64, pub net_aggregate: NetTotals, - pub top_processes: Vec + pub top_processes: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct NetTotals { pub rx_bytes: u64, - pub tx_bytes: u64 + pub tx_bytes: u64, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -28,5 +28,5 @@ pub struct Proc { pub name: String, pub cpu: f32, pub mem_mb: u64, - pub status: String + pub status: String, } \ No newline at end of file diff --git a/socktop_agent/src/state.rs b/socktop_agent/src/state.rs index 5a1efde..86a4b16 100644 --- a/socktop_agent/src/state.rs +++ b/socktop_agent/src/state.rs @@ -45,7 +45,7 @@ impl AppState { last_json: Arc::new(RwLock::new(String::new())), client_count: Arc::new(AtomicUsize::new(0)), wake_sampler: Arc::new(Notify::new()), - auth_token: std::env::var("SOCKTOP_TOKEN").ok().filter(|s| !s.is_empty()) + auth_token: std::env::var("SOCKTOP_TOKEN").ok().filter(|s| !s.is_empty()), } } }