From 5dd33b2b068d339c85d60b1f3c26aeb8ba2e5be4 Mon Sep 17 00:00:00 2001 From: fdai7375 Date: Thu, 2 Feb 2023 19:00:00 +0100 Subject: [PATCH] refactoring: move variables into the format string --- src/builtins/fetch.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtins/fetch.rs b/src/builtins/fetch.rs index f07ea29..c334980 100644 --- a/src/builtins/fetch.rs +++ b/src/builtins/fetch.rs @@ -20,7 +20,7 @@ impl Builtin for Fetch { "@".bold(), hostname().bright_green().bold() ); - println!("{}", line); + println!("{line}"); println!( "{} {} {}", "OS".bright_blue().bold(), @@ -50,7 +50,7 @@ fn format_uptime(uptime: u64) -> String { let m = (uptime - h * 3600) / 60; let s = uptime - (h * 3600 + m * 60); - format!("{:.0}h {:.0}m {:.0}s", h, m, s) + format!("{h:.0}h {m:.0}m {s:.0}s") } fn bytes_to_mebi_bytes(bytes: u64) -> u64 {