Skip to content

refactor: removing unnecessary references in fn signatures#10703

Merged
sylvestre merged 1 commit intouutils:mainfrom
nyurik:refs
Feb 4, 2026
Merged

refactor: removing unnecessary references in fn signatures#10703
sylvestre merged 1 commit intouutils:mainfrom
nyurik:refs

Conversation

@nyurik
Copy link
Contributor

@nyurik nyurik commented Feb 4, 2026

Address all suggestions of clippy::trivially_copy_pass_by_ref

Seems cleaner, and I wonder if perf would be affected

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 4, 2026

Merging this PR will not alter performance

✅ 284 untouched benchmarks
⏩ 38 skipped benchmarks1


Comparing nyurik:refs (0e4c25e) with main (368230e)

Open in CodSpeed

Footnotes

  1. 38 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sylvestre
Copy link
Contributor

Could you please update the clippy configuration to make sure we don't regress in the future

@nyurik
Copy link
Contributor Author

nyurik commented Feb 4, 2026

Could you please update the clippy configuration to make sure we don't regress in the future

already done -- this PR removes trivially_copy_pass_by_ref in Cargo.toml

@sylvestre
Copy link
Contributor

i missed it, sorry

@xtqqczze
Copy link
Contributor

xtqqczze commented Feb 4, 2026

https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

@nyurik In future, please add link to the lint in PR description

@xtqqczze
Copy link
Contributor

xtqqczze commented Feb 4, 2026

https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

  • It's quite possible this could regress performance on 32-bit targets, how about setting trivial-copy-size-limit = 4?
  • The lint has issues with false positives introducing undefined behavior with unsafe code

@nyurik
Copy link
Contributor Author

nyurik commented Feb 4, 2026

@xtqqczze should we optimize for 32 or for 64 bit platforms? I would optimize for 64 as a much more common one, and only look at specific exceptions if we identify any bottlenecks - this keeps code simpler (Copy values are easier to work with).

I haven't seen any unsafe usages - do you have any specific one in mind?

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

…nces

Address all suggestions of `clippy::trivially_copy_pass_by_ref`

Seems cleaner, and I wonder if perf would be affected
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre merged commit 9254531 into uutils:main Feb 4, 2026
154 of 156 checks passed
@nyurik nyurik deleted the refs branch February 4, 2026 22:09
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.

3 participants