Skip to content

dirname: get rid of needless Cow#11960

Merged
cakebaker merged 1 commit into
uutils:mainfrom
ChrisDenton:cow
Apr 23, 2026
Merged

dirname: get rid of needless Cow#11960
cakebaker merged 1 commit into
uutils:mainfrom
ChrisDenton:cow

Conversation

@ChrisDenton
Copy link
Copy Markdown
Contributor

All the returns are Borrowed so let's just return a &[u8] directly.

@cakebaker cakebaker changed the title Get rid of needless Cow dirname: get rid of needless Cow Apr 23, 2026
@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Apr 23, 2026

any chance for clippy detection?

@ChrisDenton
Copy link
Copy Markdown
Contributor Author

ChrisDenton commented Apr 23, 2026

There's an issue but not implementation yet: rust-lang/rust-clippy#11328

@ChrisDenton
Copy link
Copy Markdown
Contributor Author

Oh, wait, that's only for String::new. I can't see anything more generally for Cow::borrowed.

@github-actions
Copy link
Copy Markdown

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/date/resolution (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/pipe-f (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/symlink (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 23, 2026

Merging this PR will improve performance by 31.27%

⚡ 1 improved benchmark
✅ 241 untouched benchmarks
⏩ 113 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory cp_recursive_deep_tree[(120, 4)] 699.2 KB 532.7 KB +31.27%

Comparing ChrisDenton:cow (bdcba3b) with main (22bd036)

Open in CodSpeed

Footnotes

  1. 113 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.

@cakebaker cakebaker merged commit 896c685 into uutils:main Apr 23, 2026
168 of 169 checks passed
@cakebaker
Copy link
Copy Markdown
Contributor

Thanks for your PR!

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