refactor: remove unused name attribute
This commit is contained in:
parent
7264d127d9
commit
93de64f4b9
2 changed files with 6 additions and 11 deletions
|
|
@ -1,18 +1,14 @@
|
|||
#[derive(Clone, Debug)]
|
||||
pub struct SysinfoSnapshot {
|
||||
pub cpu_total: f32,
|
||||
pub cpus: Vec<(String, f32)>,
|
||||
pub cpus: Vec<f32>,
|
||||
}
|
||||
|
||||
impl From<&sysinfo::System> for SysinfoSnapshot {
|
||||
fn from(value: &sysinfo::System) -> Self {
|
||||
Self {
|
||||
cpu_total: value.global_cpu_usage(),
|
||||
cpus: value
|
||||
.cpus()
|
||||
.iter()
|
||||
.map(|cpu| (cpu.name().into(), cpu.cpu_usage()))
|
||||
.collect(),
|
||||
cpus: value.cpus().iter().map(|cpu| cpu.cpu_usage()).collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue