1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

Merge pull request #6636 from BenWiederhake/dev-newest-clippy

dircolors+join+sleep: optimize int and string ops as required by clippy nightly
This commit is contained in:
Daniel Hofstetter 2024-08-12 14:22:23 +02:00 committed by GitHub
commit e8f14c76fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -469,7 +469,7 @@ fn escape(s: &str) -> String {
match c { match c {
'\'' => result.push_str("'\\''"), '\'' => result.push_str("'\\''"),
':' if previous != '\\' => result.push_str("\\:"), ':' if previous != '\\' => result.push_str("\\:"),
_ => result.push_str(&c.to_string()), _ => result.push(c),
} }
previous = c; previous = c;
} }

View file

@ -654,7 +654,7 @@ fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> {
settings.autoformat = true; settings.autoformat = true;
} else { } else {
let mut specs = vec![]; let mut specs = vec![];
for part in format.split(|c| c == ' ' || c == ',' || c == '\t') { for part in format.split([' ', ',', '\t']) {
specs.push(Spec::parse(part)?); specs.push(Spec::parse(part)?);
} }
settings.format = specs; settings.format = specs;

View file

@ -138,7 +138,7 @@ fn test_sleep_wrong_time() {
#[test] #[test]
fn test_sleep_when_single_input_exceeds_max_duration_then_no_error() { fn test_sleep_when_single_input_exceeds_max_duration_then_no_error() {
let mut child = new_ucmd!() let mut child = new_ucmd!()
.arg(format!("{}", u64::MAX as u128 + 1)) .arg(format!("{}", u128::from(u64::MAX) + 1))
.timeout(Duration::from_secs(10)) .timeout(Duration::from_secs(10))
.run_no_wait(); .run_no_wait();