mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
rustfmt two files
This commit is contained in:
parent
5935876f38
commit
c06967a45a
2 changed files with 7 additions and 13 deletions
|
@ -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<time_t>) -> 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,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -247,7 +247,6 @@ fn test_leading_whitespace_should_imply_padding() {
|
|||
.run()
|
||||
.stdout_is(" 1000\n");
|
||||
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["--from=auto"])
|
||||
.pipe_in(" 202Ki")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue