Skip to content

clippy(cp): fix collapsible_if lint#11288

Merged
cakebaker merged 1 commit intouutils:mainfrom
mattsu2020:cp_collapsible_if
Mar 11, 2026
Merged

clippy(cp): fix collapsible_if lint#11288
cakebaker merged 1 commit intouutils:mainfrom
mattsu2020:cp_collapsible_if

Conversation

@mattsu2020
Copy link
Contributor

Summary

  • apply clippy::collapsible_if fixes in cp.rs and copydir.rs
  • replace nested conditionals with let chains where applicable
  • keep behavior unchanged while simplifying the control flow

Testing

  • cargo +stable test -p uu_cp --lib

How it was applied

cargo +stable clippy -p uu_cp --fix --all-targets --all-features -- -A clippy::all -W clippy::collapsible_if
cargo +stable fmt --all -- --emit files

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Congrats! The gnu test tests/cut/cut-huge-range is now passing!

@cakebaker cakebaker merged commit d719f61 into uutils:main Mar 11, 2026
158 of 159 checks passed
@cakebaker
Copy link
Contributor

Thanks!

@mattsu2020 mattsu2020 deleted the cp_collapsible_if branch March 11, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants