diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index 437668947..61a3b8c29 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -5,6 +5,9 @@ // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. +// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422 +#![allow(clippy::nonstandard_macro_braces)] + #[macro_use] extern crate uucore; @@ -416,26 +419,22 @@ impl Display for DuError { DuError::SummarizeDepthConflict(s) => { write!(f, "summarizing conflicts with --max-depth={}", s) } - DuError::InvalidTimeStyleArg(s) => { - write!( - f, - "invalid argument '{}' for 'time style' + DuError::InvalidTimeStyleArg(s) => write!( + f, + "invalid argument '{}' for 'time style' Valid arguments are: - 'full-iso' - 'long-iso' - 'iso' Try '{} --help' for more information.", - s, NAME - ) - } - DuError::InvalidTimeArg(s) => { - write!( - f, - "Invalid argument '{}' for --time. + s, NAME + ), + DuError::InvalidTimeArg(s) => write!( + f, + "Invalid argument '{}' for --time. 'birth' and 'creation' arguments are not supported on this platform.", - s - ) - } + s + ), } } } diff --git a/src/uu/tr/src/tr.rs b/src/uu/tr/src/tr.rs index 45a3027b2..6dd81badf 100644 --- a/src/uu/tr/src/tr.rs +++ b/src/uu/tr/src/tr.rs @@ -233,10 +233,9 @@ fn get_usage() -> String { } fn get_long_usage() -> String { - format!( - "Translate, squeeze, and/or delete characters from standard input, -writing to standard output.", - ) + "Translate, squeeze, and/or delete characters from standard input, +writing to standard output." + .to_string() } pub fn uumain(args: impl uucore::Args) -> i32 { diff --git a/tests/by-util/test_whoami.rs b/tests/by-util/test_whoami.rs index 0afe94161..3e8d5afa6 100644 --- a/tests/by-util/test_whoami.rs +++ b/tests/by-util/test_whoami.rs @@ -39,7 +39,6 @@ fn test_normal_compare_env() { let whoami = whoami(); if whoami == "nobody" { println!("test skipped:"); - return; } else if !is_ci() { new_ucmd!().succeeds().stdout_is(format!("{}\n", whoami)); } else { diff --git a/tests/common/util.rs b/tests/common/util.rs index 7a641a353..68b7caa9b 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -1065,7 +1065,7 @@ pub fn whoami() -> String { /// Add prefix 'g' for `util_name` if not on linux #[cfg(unix)] -pub fn host_name_for<'a>(util_name: &'a str) -> Cow<'a, str> { +pub fn host_name_for(util_name: &str) -> Cow { // In some environments, e.g. macOS/freebsd, the GNU coreutils are prefixed with "g" // to not interfere with the BSD counterparts already in `$PATH`. #[cfg(not(target_os = "linux"))]