Skip to content

fix(atlas-redact): collapse identical if/else-if branches (clippy) - #97

Closed
ithun-y-ittesaf wants to merge 1 commit into
pacifio:mainfrom
ithun-y-ittesaf:fix/atlas-redact-clippy
Closed

fix(atlas-redact): collapse identical if/else-if branches (clippy)#97
ithun-y-ittesaf wants to merge 1 commit into
pacifio:mainfrom
ithun-y-ittesaf:fix/atlas-redact-clippy

Conversation

@ithun-y-ittesaf

Copy link
Copy Markdown
Contributor

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.

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>
@ahammadnafiz

Copy link
Copy Markdown
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

@ithun-y-ittesaf

Copy link
Copy Markdown
Contributor Author

@ithun-y-ittesaf can you check branch 0.2.5 is this issue solved on this branch because i have updated the test cases

Sure, let me get back to this.

@uzayer

uzayer commented Aug 11, 2026

Copy link
Copy Markdown
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.

@uzayer uzayer closed this Aug 11, 2026
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