From c06967a45a9562f93cdb71a97d43811272e1ee26 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 23 Feb 2021 20:56:36 +0100 Subject: [PATCH] rustfmt two files --- src/uu/uptime/src/uptime.rs | 19 +++++++------------ tests/by-util/test_numfmt.rs | 1 - 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/uu/uptime/src/uptime.rs b/src/uu/uptime/src/uptime.rs index 44360f515..4ea90e242 100644 --- a/src/uu/uptime/src/uptime.rs +++ b/src/uu/uptime/src/uptime.rs @@ -137,10 +137,7 @@ fn print_nusers(nusers: usize) { fn print_time() { let local_time = Local::now().time(); - print!( - " {} ", - local_time.format("%H:%M:%S") - ); + print!(" {} ", local_time.format("%H:%M:%S")); } #[cfg(unix)] @@ -156,15 +153,13 @@ fn get_uptime(boot_time: Option) -> i64 { .and_then(|_| proc_uptime_s.split_whitespace().next()) .and_then(|s| s.split('.').next().unwrap_or("0").parse().ok()); - proc_uptime.unwrap_or_else(|| { - match boot_time { - Some(t) => { - let now = Local::now().timestamp(); - let boottime = t as i64; - now - boottime - } - None => -1, + proc_uptime.unwrap_or_else(|| match boot_time { + Some(t) => { + let now = Local::now().timestamp(); + let boottime = t as i64; + now - boottime } + None => -1, }) } diff --git a/tests/by-util/test_numfmt.rs b/tests/by-util/test_numfmt.rs index 61667f310..f15371aed 100644 --- a/tests/by-util/test_numfmt.rs +++ b/tests/by-util/test_numfmt.rs @@ -247,7 +247,6 @@ fn test_leading_whitespace_should_imply_padding() { .run() .stdout_is(" 1000\n"); - new_ucmd!() .args(&["--from=auto"]) .pipe_in(" 202Ki")