refactor: use new fn over raw struct initialization

This commit is contained in:
electria 2026-08-15 18:18:43 -07:00
commit 20f68eaa60
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -37,7 +37,7 @@ impl canvas::Program<app::Message, Theme, Renderer> for CpuGraph {
for (index, value) in self.timeline.iter().enumerate() {
let x = index as f32 / self.timeline.len() as f32 * bounds.width;
let y = bounds.height - value / 100. * bounds.height;
builder.line_to(Point { x, y })
builder.line_to(Point::new(x, y))
}
}),
canvas::Stroke::default().with_color(CYAN),