Skip to content

Commit

Permalink
simplify a bit of code
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementTsang committed Mar 1, 2023
1 parent 6edc92b commit 241a81f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/app/data_harvester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,12 @@ impl DataCollector {

// CPU
if self.widgets_to_harvest.use_cpu {
if let Ok(cpu_data) = cpu::get_cpu_data_list(&self.sys, self.show_average_cpu) {
self.data.cpu = Some(cpu_data);
}
self.data.cpu = cpu::get_cpu_data_list(&self.sys, self.show_average_cpu).ok();

#[cfg(target_family = "unix")]
{
// Load Average
if let Ok(load_avg_data) = cpu::get_load_avg() {
self.data.load_avg = Some(load_avg_data);
}
self.data.load_avg = cpu::get_load_avg().ok();
}
}

Expand Down

0 comments on commit 241a81f

Please sign in to comment.