From 51e702368e4fd65a494ff7ddc0faf27286fa221a Mon Sep 17 00:00:00 2001 From: jasonwitty Date: Sun, 24 Aug 2025 12:40:35 -0700 Subject: [PATCH] cargo fmt --- socktop_agent/src/metrics.rs | 2 +- socktop_agent/src/state.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/socktop_agent/src/metrics.rs b/socktop_agent/src/metrics.rs index 85e0d00..bff201b 100644 --- a/socktop_agent/src/metrics.rs +++ b/socktop_agent/src/metrics.rs @@ -11,9 +11,9 @@ use std::fs; #[cfg(target_os = "linux")] use std::io; use std::sync::Mutex; +use std::time::Duration as StdDuration; use std::time::{Duration, Instant}; use sysinfo::{ProcessRefreshKind, ProcessesToUpdate}; -use std::time::Duration as StdDuration; use tracing::warn; // Runtime toggles (read once) diff --git a/socktop_agent/src/state.rs b/socktop_agent/src/state.rs index 099aa8e..12bffcb 100644 --- a/socktop_agent/src/state.rs +++ b/socktop_agent/src/state.rs @@ -4,9 +4,9 @@ use std::collections::HashMap; use std::sync::atomic::{AtomicBool, AtomicUsize}; use std::sync::Arc; +use std::time::{Duration, Instant}; use sysinfo::{Components, Disks, Networks, System}; use tokio::sync::Mutex; -use std::time::{Duration, Instant}; pub type SharedSystem = Arc>; pub type SharedComponents = Arc>; @@ -54,7 +54,10 @@ pub struct CacheEntry { impl CacheEntry { pub fn new() -> Self { - Self { at: None, value: None } + Self { + at: None, + value: None, + } } pub fn is_fresh(&self, ttl: Duration) -> bool { self.at.is_some_and(|t| t.elapsed() < ttl) && self.value.is_some()