Skip to content

Keep string and Boolean comparison fixes in traversal order - #98

Open
charliermarsh wants to merge 2 commits into
charlie/track-clippy-macro-filter-sourcefrom
charlie/order-string-comparison-fixes
Open

charliermarsh wants to merge 2 commits into
charlie/track-clippy-macro-filter-sourcefrom
charlie/order-string-comparison-fixes

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

For !matches!(s.to_string() != "".to_owned(), true), Clippy needs to simplify the inner string comparison before removing matches!. In the opposite order, the fixer can try to negate a String and roll back the file.

We now run the length, empty-value and case-insensitive comparison lints alongside the Boolean checks. We track the text they read and restore the relative order of match_bool and needless_match.

Of 144 generated cases, 119 passed after stock Clippy applied fixes. All 119 also passed here. Ohm −6 rolled back six of them. Eight first-pass edits differed from stock in source text but agreed on the tested values.

Closes #97.

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.

1 participant