mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Merge pull request #2494 from sylvestre/clip2
fix various clippy & rustfmt issues
This commit is contained in:
commit
92c5dc7af8
4 changed files with 17 additions and 20 deletions
|
@ -5,6 +5,9 @@
|
||||||
// * 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.
|
||||||
|
|
||||||
|
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
|
||||||
|
#![allow(clippy::nonstandard_macro_braces)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate uucore;
|
extern crate uucore;
|
||||||
|
|
||||||
|
@ -416,8 +419,7 @@ impl Display for DuError {
|
||||||
DuError::SummarizeDepthConflict(s) => {
|
DuError::SummarizeDepthConflict(s) => {
|
||||||
write!(f, "summarizing conflicts with --max-depth={}", s)
|
write!(f, "summarizing conflicts with --max-depth={}", s)
|
||||||
}
|
}
|
||||||
DuError::InvalidTimeStyleArg(s) => {
|
DuError::InvalidTimeStyleArg(s) => write!(
|
||||||
write!(
|
|
||||||
f,
|
f,
|
||||||
"invalid argument '{}' for 'time style'
|
"invalid argument '{}' for 'time style'
|
||||||
Valid arguments are:
|
Valid arguments are:
|
||||||
|
@ -426,16 +428,13 @@ Valid arguments are:
|
||||||
- 'iso'
|
- 'iso'
|
||||||
Try '{} --help' for more information.",
|
Try '{} --help' for more information.",
|
||||||
s, NAME
|
s, NAME
|
||||||
)
|
),
|
||||||
}
|
DuError::InvalidTimeArg(s) => write!(
|
||||||
DuError::InvalidTimeArg(s) => {
|
|
||||||
write!(
|
|
||||||
f,
|
f,
|
||||||
"Invalid argument '{}' for --time.
|
"Invalid argument '{}' for --time.
|
||||||
'birth' and 'creation' arguments are not supported on this platform.",
|
'birth' and 'creation' arguments are not supported on this platform.",
|
||||||
s
|
s
|
||||||
)
|
),
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,10 +233,9 @@ fn get_usage() -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_long_usage() -> String {
|
fn get_long_usage() -> String {
|
||||||
format!(
|
|
||||||
"Translate, squeeze, and/or delete characters from standard input,
|
"Translate, squeeze, and/or delete characters from standard input,
|
||||||
writing to standard output.",
|
writing to standard output."
|
||||||
)
|
.to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
|
|
|
@ -39,7 +39,6 @@ fn test_normal_compare_env() {
|
||||||
let whoami = whoami();
|
let whoami = whoami();
|
||||||
if whoami == "nobody" {
|
if whoami == "nobody" {
|
||||||
println!("test skipped:");
|
println!("test skipped:");
|
||||||
return;
|
|
||||||
} else if !is_ci() {
|
} else if !is_ci() {
|
||||||
new_ucmd!().succeeds().stdout_is(format!("{}\n", whoami));
|
new_ucmd!().succeeds().stdout_is(format!("{}\n", whoami));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1065,7 +1065,7 @@ pub fn whoami() -> String {
|
||||||
|
|
||||||
/// Add prefix 'g' for `util_name` if not on linux
|
/// Add prefix 'g' for `util_name` if not on linux
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn host_name_for<'a>(util_name: &'a str) -> Cow<'a, str> {
|
pub fn host_name_for(util_name: &str) -> Cow<str> {
|
||||||
// In some environments, e.g. macOS/freebsd, the GNU coreutils are prefixed with "g"
|
// In some environments, e.g. macOS/freebsd, the GNU coreutils are prefixed with "g"
|
||||||
// to not interfere with the BSD counterparts already in `$PATH`.
|
// to not interfere with the BSD counterparts already in `$PATH`.
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue