Skip to content

fix: assert_is_empty clippy lint - #14472

Open
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:lint/assert_is_empty
Open

xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:lint/assert_is_empty

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

The assert_is_empty lint will be stable in Rust 1.98 on 2026-10-01.

Closes #14917.

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/id/setgid is no longer failing!

@xtqqczze

This comment was marked as outdated.

@xtqqczze
xtqqczze marked this pull request as ready for review September 9, 2026 02:38
@xtqqczze
xtqqczze marked this pull request as draft September 9, 2026 10:37
@xtqqczze
xtqqczze force-pushed the lint/assert_is_empty branch from 19faac5 to 058706c Compare September 26, 2026 09:45
@codspeed

codspeed Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.07%

❌ 1 regressed benchmark
✅ 212 untouched benchmarks
⏩ 234 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation five_38_bit_primes 1.8 s 1.9 s -6.07%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing xtqqczze:lint/assert_is_empty (1526605) with main (2b85f6f)

Open in CodSpeed

Footnotes

  1. 234 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. ↩

@xtqqczze
xtqqczze marked this pull request as ready for review September 26, 2026 21:40
Comment thread src/uu/chmod/src/chmod.rs
assert_eq!(c, None);
assert_eq!(a, ["--", "-r", "file"]);
assert!(i.is_empty());
assert_eq!(i, [] as [_; 0]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not convinced it is better and easier to understand

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The benefit is supposedly that the assertion will report what the asserted value contained, instead of a boolean.

This branch has not been deployed

No deployments
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.

fix assert_is_empty clippy lint

2 participants