Skip to content

Commit

Permalink
⬆️ Implement breaking changes for sysinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kenji committed Feb 11, 2024
1 parent ec27ca3 commit bac5dc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion client/src/plugin/resource_monitor/cpu.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::plugin::utils::Plugin;
use sysinfo::{CpuExt, SystemExt};

pub struct CpuPlugin {
sysinfo: sysinfo::System,
Expand Down
9 changes: 4 additions & 5 deletions client/src/plugin/resource_monitor/disks.rs
Original file line number Diff line number Diff line change
@@ -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<crate::model::Entry>,
}

Expand All @@ -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()
Expand Down Expand Up @@ -63,7 +62,7 @@ impl Plugin for DisksPlugin {

fn new() -> Self {
Self {
sysinfo: sysinfo::System::new_all(),
disks: sysinfo::Disks::new(),
entries: vec![],
}
}
Expand Down
1 change: 0 additions & 1 deletion client/src/plugin/resource_monitor/memory.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::plugin::utils::Plugin;
use sysinfo::SystemExt;

pub struct MemoryPlugin {
sysinfo: sysinfo::System,
Expand Down

0 comments on commit bac5dc6

Please sign in to comment.