Skip to content

Mechanical clippy cleanups - #1636

Merged
sbillig merged 4 commits into
masterfrom
simplify-lints
Sep 29, 2026
Merged

sbillig merged 4 commits into
masterfrom
simplify-lints

Conversation

@sbillig

@sbillig sbillig commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Four behavior-preserving clippy passes. Net -566 lines.

  • Inline format arguments (uninlined_format_args)
  • Collapse map/unwrap_or chains (map_unwrap_or) —
    .map(f).unwrap_or(x) becomes .map_or(x, f)
  • Flatten match-only control flow (manual_let_else,
    single_match_else, redundant_else, needless_continue)
  • Drop redundant clones (redundant_clone,
    cloned_instead_of_copied)

Apply `clippy::uninlined_format_args` throughout: captured identifiers
move into the format string instead of being passed positionally. No
behavior change.
Apply `clippy::map_unwrap_or`: `.map(f).unwrap_or(x)` becomes
`.map_or(x, f)` and `.map(f).unwrap_or_else(g)` becomes
`.map_or_else(g, f)`. Both forms are exact equivalents, so this is a
pure line-count reduction. A handful of sites are left alone because
the combined form would need unique access to the same receiver from
two closures at once.
Apply the control-flow half of clippy's pedantic set: `manual_let_else`,
`single_match_else`, `redundant_else` and `needless_continue`. Two-arm
matches whose fallback diverges become `let ... else` bindings, `else`
blocks after a diverging `if` lose their nesting level, and redundant
`continue` statements go away.

Where clippy's rewrite would have been a step backwards the original
shape is kept: two sites whose fallback produces a value stay as
`match`, and one site is left alone because rustfmt does not reach a
fixed point on the rewritten expression.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T18:25:04.907926Z 05ce0f4 New commits
🔒 Security Review ✅ Completed 2026-09-29T18:30:06.736757Z 05ce0f4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sbillig
sbillig added this pull request to stack #1639 September 29, 2026 18:11
Apply `clippy::redundant_clone` and `clippy::cloned_instead_of_copied`:
values that are already owned stop being cloned, and iterator adapters
over `Copy` elements use `copied()` instead of `cloned()`. Fewer
allocations, same results.
@sbillig
sbillig merged commit 8f1c743 into master Sep 29, 2026
9 checks passed
@sbillig
sbillig deleted the simplify-lints branch September 29, 2026 19:53
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