Skip to content

Commit

Permalink
Merge pull request uutils#6636 from BenWiederhake/dev-newest-clippy
Browse files Browse the repository at this point in the history
dircolors+join+sleep: optimize int and string ops as required by clippy nightly
  • Loading branch information
cakebaker committed Aug 12, 2024
2 parents f0e8cf2 + 9eb7c85 commit e8f14c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/uu/dircolors/src/dircolors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ fn escape(s: &str) -> String {
match c {
'\'' => result.push_str("'\\''"),
':' if previous != '\\' => result.push_str("\\:"),
_ => result.push_str(&c.to_string()),
_ => result.push(c),
}
previous = c;
}
Expand Down
2 changes: 1 addition & 1 deletion src/uu/join/src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ fn parse_settings(matches: &clap::ArgMatches) -> UResult<Settings> {
settings.autoformat = true;
} else {
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)?);
}
settings.format = specs;
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_sleep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn test_sleep_wrong_time() {
#[test]
fn test_sleep_when_single_input_exceeds_max_duration_then_no_error() {
let mut child = new_ucmd!()
.arg(format!("{}", u64::MAX as u128 + 1))
.arg(format!("{}", u128::from(u64::MAX) + 1))
.timeout(Duration::from_secs(10))
.run_no_wait();

Expand Down

0 comments on commit e8f14c7

Please sign in to comment.