Skip to content

Commit e8f14c7

Browse files
authored
Merge pull request #6636 from BenWiederhake/dev-newest-clippy
dircolors+join+sleep: optimize int and string ops as required by clippy nightly
2 parents f0e8cf2 + 9eb7c85 commit e8f14c7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/uu/dircolors/src/dircolors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ fn escape(s: &str) -> String {
469469
match c {
470470
'\'' => result.push_str("'\\''"),
471471
':' if previous != '\\' => result.push_str("\\:"),
472-
_ => result.push_str(&c.to_string()),
472+
_ => result.push(c),
473473
}
474474
previous = c;
475475
}

src/uu/join/src/join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> {
654654
settings.autoformat = true;
655655
} else {
656656
let mut specs = vec![];
657-
for part in format.split(|c| c == ' ' || c == ',' || c == '\t') {
657+
for part in format.split([' ', ',', '\t']) {
658658
specs.push(Spec::parse(part)?);
659659
}
660660
settings.format = specs;

tests/by-util/test_sleep.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn test_sleep_wrong_time() {
138138
#[test]
139139
fn test_sleep_when_single_input_exceeds_max_duration_then_no_error() {
140140
let mut child = new_ucmd!()
141-
.arg(format!("{}", u64::MAX as u128 + 1))
141+
.arg(format!("{}", u128::from(u64::MAX) + 1))
142142
.timeout(Duration::from_secs(10))
143143
.run_no_wait();
144144

0 commit comments

Comments
 (0)