Skip to content

Keep owned comparison fixes alongside redundant clone checks - #90

Open
charliermarsh wants to merge 1 commit into
charlie/keep-boolean-suggestions-togetherfrom
charlie/keep-owned-comparison-suggestions-together
Open

charliermarsh wants to merge 1 commit into
charlie/keep-boolean-suggestions-togetherfrom
charlie/keep-owned-comparison-suggestions-together

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

For key.to_owned() == stored, the available PartialEq implementation can require stored == key after removing the allocation. The cmp_owned lint makes that edit. The overlapping redundant_clone suggestion just removes .to_owned(). If its traversal finishes last, the fix tool keeps key == stored, gets a type error and rolls the change back.

We now run both lints in the same traversal and record the source reads that determine the replacement. The complete comparison comes last on the initial run and on replay.

Closes #89.

@charliermarsh
charliermarsh marked this pull request as ready for review November 21, 2026 14: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.

1 participant