fix(atlas-redact): collapse identical if/else-if branches (clippy) - #97
Closed
ithun-y-ittesaf wants to merge 1 commit into
Closed
fix(atlas-redact): collapse identical if/else-if branches (clippy)#97ithun-y-ittesaf wants to merge 1 commit into
ithun-y-ittesaf wants to merge 1 commit into
Conversation
segments()'s two camelCase word-boundary conditions both pushed the same `out.push(std::mem::take(&mut current))`, just under different guards - clippy's if_same_then_else (denied via -D warnings) flagged it, breaking the atlas-redact CI job on main. Merged into one `if` with the two boundary conditions OR'd together; same semantics, verified with the existing 65+ test suite. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
|
@ithun-y-ittesaf can you check branch 0.2.5 is this issue solved on this branch because i have updated the test cases |
Contributor
Author
Sure, let me get back to this. |
2 tasks
Collaborator
|
Thanks for the fix! This same clippy issue (identical if/else-if branches in the acronym-splitting logic) was independently fixed in 84e7204 ("fix(atlas-redact): merge identical if/else-if branches in acronym split"), already merged to main/0.2.6 — same collapsed condition. Closing as a duplicate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's a function that splits keys like myAPIKey into words (my, api, key). It had two separate if checks for "is this the start of a new word?" and when either one was true, they both did the exact same thing. Rust's linter (clippy) flags that as a mistake ("why write it twice?"), and CI treats linter warnings as hard failures, so the build was red.
Fix: combined the two checks into one if (with an "or") since they led to the same action anyway. No behavior change, verified against the existing 65+ test suite.