refactor: remove unused name attribute

This commit is contained in:
electria 2026-08-15 18:42:53 -07:00
commit 93de64f4b9
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs
2 changed files with 6 additions and 11 deletions

View file

@ -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(),
}
}
}