mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #7887 from cakebaker/uptime_fix_typo_in_fn_name
uptime: fix typo (formated -> formatted)
This commit is contained in:
commit
0d8362bc8d
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
// For the full copyright and license information, please view the LICENSE
|
// For the full copyright and license information, please view the LICENSE
|
||||||
// file that was distributed with this source code.
|
// file that was distributed with this source code.
|
||||||
|
|
||||||
// spell-checker:ignore getloadavg behaviour loadavg uptime upsecs updays upmins uphours boottime nusers utmpxname gettime clockid formated
|
// spell-checker:ignore getloadavg behaviour loadavg uptime upsecs updays upmins uphours boottime nusers utmpxname gettime clockid
|
||||||
|
|
||||||
use chrono::{Local, TimeZone, Utc};
|
use chrono::{Local, TimeZone, Utc};
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
|
@ -296,6 +296,6 @@ fn print_time() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_uptime(boot_time: Option<time_t>) -> UResult<()> {
|
fn print_uptime(boot_time: Option<time_t>) -> UResult<()> {
|
||||||
print!("up {}, ", get_formated_uptime(boot_time)?);
|
print!("up {}, ", get_formatted_uptime(boot_time)?);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// For the full copyright and license information, please view the LICENSE
|
// For the full copyright and license information, please view the LICENSE
|
||||||
// file that was distributed with this source code.
|
// file that was distributed with this source code.
|
||||||
|
|
||||||
// spell-checker:ignore gettime BOOTTIME clockid boottime formated nusers loadavg getloadavg
|
// spell-checker:ignore gettime BOOTTIME clockid boottime nusers loadavg getloadavg
|
||||||
|
|
||||||
//! Provides functions to get system uptime, number of users and load average.
|
//! Provides functions to get system uptime, number of users and load average.
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
|
||||||
///
|
///
|
||||||
/// Returns a UResult with the uptime in a human-readable format(e.g. "1 day, 3:45") if successful, otherwise an UptimeError.
|
/// Returns a UResult with the uptime in a human-readable format(e.g. "1 day, 3:45") if successful, otherwise an UptimeError.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_formated_uptime(boot_time: Option<time_t>) -> UResult<String> {
|
pub fn get_formatted_uptime(boot_time: Option<time_t>) -> UResult<String> {
|
||||||
let up_secs = get_uptime(boot_time)?;
|
let up_secs = get_uptime(boot_time)?;
|
||||||
|
|
||||||
if up_secs < 0 {
|
if up_secs < 0 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue