diff --git a/client/src/plugin/resource_monitor/cpu.rs b/client/src/plugin/resource_monitor/cpu.rs index 5ddaa53..607e82f 100644 --- a/client/src/plugin/resource_monitor/cpu.rs +++ b/client/src/plugin/resource_monitor/cpu.rs @@ -1,5 +1,4 @@ use crate::plugin::utils::Plugin; -use sysinfo::{CpuExt, SystemExt}; pub struct CpuPlugin { sysinfo: sysinfo::System, diff --git a/client/src/plugin/resource_monitor/disks.rs b/client/src/plugin/resource_monitor/disks.rs index abdccbb..0d0fd02 100644 --- a/client/src/plugin/resource_monitor/disks.rs +++ b/client/src/plugin/resource_monitor/disks.rs @@ -1,9 +1,8 @@ use crate::plugin::utils::Plugin; use anyhow::Context; -use sysinfo::{DiskExt, SystemExt}; pub struct DisksPlugin { - sysinfo: sysinfo::System, + disks: sysinfo::Disks, entries: Vec, } @@ -29,10 +28,10 @@ impl Plugin for DisksPlugin { } fn update_entries(&mut self) -> anyhow::Result<()> { - self.sysinfo.refresh_all(); + self.disks.refresh_list(); self.entries.clear(); - for disk in self.sysinfo.disks() { + for disk in &self.disks { let mount_point = disk .mount_point() .to_str() @@ -63,7 +62,7 @@ impl Plugin for DisksPlugin { fn new() -> Self { Self { - sysinfo: sysinfo::System::new_all(), + disks: sysinfo::Disks::new(), entries: vec![], } } diff --git a/client/src/plugin/resource_monitor/memory.rs b/client/src/plugin/resource_monitor/memory.rs index 1ba27e4..793db15 100644 --- a/client/src/plugin/resource_monitor/memory.rs +++ b/client/src/plugin/resource_monitor/memory.rs @@ -1,5 +1,4 @@ use crate::plugin::utils::Plugin; -use sysinfo::SystemExt; pub struct MemoryPlugin { sysinfo: sysinfo::System,