fix clippy format warnings

This commit is contained in:
jasonwitty 2025-08-11 14:30:41 -07:00
parent 250f7bf93a
commit 0cbba6b290
3 changed files with 5 additions and 5 deletions

View File

@ -75,7 +75,7 @@ pub fn draw_gpu(f: &mut ratatui::Frame<'_>, area: Rect, m: Option<&Metrics>) {
let g = &gpus[i]; let g = &gpus[i];
// Row 1: GPU name (and temp can be appended later) // Row 1: GPU name (and temp can be appended later)
let name_text = format!("{}", g.name); let name_text = g.name.clone();
f.render_widget( f.render_widget(
Paragraph::new(Span::raw(name_text)).style(Style::default().fg(Color::Gray)), Paragraph::new(Span::raw(name_text)).style(Style::default().fg(Color::Gray)),
rows[i * 3], rows[i * 3],
@ -90,7 +90,7 @@ pub fn draw_gpu(f: &mut ratatui::Frame<'_>, area: Rect, m: Option<&Metrics>) {
.ratio(util as f64 / 100.0); .ratio(util as f64 / 100.0);
f.render_widget(util_gauge, util_cols[0]); f.render_widget(util_gauge, util_cols[0]);
f.render_widget( f.render_widget(
Paragraph::new(Span::raw(format!("util: {}%", util))).style(Style::default().fg(Color::Gray)), Paragraph::new(Span::raw(format!("util: {util}%"))).style(Style::default().fg(Color::Gray)),
util_cols[1], util_cols[1],
); );
@ -107,7 +107,7 @@ pub fn draw_gpu(f: &mut ratatui::Frame<'_>, area: Rect, m: Option<&Metrics>) {
.ratio(mem_ratio); .ratio(mem_ratio);
f.render_widget(mem_gauge, mem_cols[0]); f.render_widget(mem_gauge, mem_cols[0]);
f.render_widget( f.render_widget(
Paragraph::new(Span::raw(format!("vram: {}/{} ({}%)", fmt_bytes(used), fmt_bytes(total), mem_pct))) Paragraph::new(Span::raw(format!("vram: {}/{} ({mem_pct}%)", fmt_bytes(used), fmt_bytes(total))))
.style(Style::default().fg(Color::Gray)), .style(Style::default().fg(Color::Gray)),
mem_cols[1], mem_cols[1],
); );

View File

@ -18,7 +18,7 @@ pub fn draw_header(f: &mut ratatui::Frame<'_>, area: Rect, m: Option<&Metrics>)
} else { } else {
"🔥" "🔥"
}; };
format!("CPU Temp: {:.1}°C {}", t, icon) format!("CPU Temp: {t:.1}°C {icon}")
}) })
.unwrap_or_else(|| "CPU Temp: N/A".into()); .unwrap_or_else(|| "CPU Temp: N/A".into());
format!( format!(

View File

@ -64,7 +64,7 @@ pub fn draw_top_processes(f: &mut ratatui::Frame<'_>, area: Rect, m: Option<&Met
Cell::from(p.name.clone()), Cell::from(p.name.clone()),
Cell::from(format!("{:.1}%", p.cpu_usage)).style(Style::default().fg(cpu_fg)), Cell::from(format!("{:.1}%", p.cpu_usage)).style(Style::default().fg(cpu_fg)),
Cell::from(human(p.mem_bytes)), Cell::from(human(p.mem_bytes)),
Cell::from(format!("{:.2}%", mem_pct)).style(Style::default().fg(mem_fg)), Cell::from(format!("{mem_pct:.2}%")).style(Style::default().fg(mem_fg)),
]) ])
.style(zebra.patch(emphasis)) .style(zebra.patch(emphasis))
}) })