Skip to content

chore(lint): enable clippy::unnested_or_patterns#168

Open
tupe12334 wants to merge 1 commit into
mainfrom
clippy/enable-unnested_or_patterns
Open

chore(lint): enable clippy::unnested_or_patterns#168
tupe12334 wants to merge 1 commit into
mainfrom
clippy/enable-unnested_or_patterns

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Summary

Promotes clippy::unnested_or_patterns (pedantic group) to deny in core/Cargo.toml's [lints.clippy] table, continuing the repo's incremental clippy ratchet.

What the lint catches

Or-patterns whose alternatives share the same outer constructor and can be collapsed into a single nested or-pattern:

Some(1) | Some(2)   =>  Some(1 | 2)

Less repetition, clearer intent (the real variation moves to the inner level), and one-token extension when adding alternatives.

Changes

  • core/Cargo.toml: add unnested_or_patterns = "deny" to [lints.clippy].

No source changes were needed — the codebase has zero violations today, so this is a clean forward guard.

Verification

  • cargo clippy --all-targets — passes (exit 0)
  • cargo build — passes
  • cargo test — passes (15 tests + doc tests)

Closes #167


This pull request was opened by the Clippy lint improvements → issue + PR (Rust repos) → Slack routine of moadim.

Promote clippy::unnested_or_patterns to deny in core/Cargo.toml, continuing
the incremental clippy ratchet. Collapses repeated outer constructors in
or-patterns (e.g. Some(1) | Some(2) -> Some(1 | 2)). Zero existing
violations; clippy, build and tests pass.

Closes #167

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Enable clippy::unnested_or_patterns lint

1 participant