Browse Source

refactoring: move variables into the format string

main
fdai7375 2 years ago
committed by fdai7451
parent
commit
310a7b3732
  1. 4
      src/builtins/fetch.rs

4
src/builtins/fetch.rs

@ -20,7 +20,7 @@ impl Builtin for Fetch {
"@".bold(), "@".bold(),
hostname().bright_green().bold() hostname().bright_green().bold()
); );
println!("{}", line);
println!("{line}");
println!( println!(
"{} {} {}", "{} {} {}",
"OS".bright_blue().bold(), "OS".bright_blue().bold(),
@ -50,7 +50,7 @@ fn format_uptime(uptime: u64) -> String {
let m = (uptime - h * 3600) / 60; let m = (uptime - h * 3600) / 60;
let s = uptime - (h * 3600 + m * 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 { fn bytes_to_mebi_bytes(bytes: u64) -> u64 {

Loading…
Cancel
Save