Skip to content

fix: resolve clippy collapsible_match warnings and pin toolchain#64

Merged
EladBezalel merged 5 commits intomainfrom
fix/clippy-collapsible-match
Apr 20, 2026
Merged

fix: resolve clippy collapsible_match warnings and pin toolchain#64
EladBezalel merged 5 commits intomainfrom
fix/clippy-collapsible-match

Conversation

@EladBezalel
Copy link
Copy Markdown
Collaborator

@EladBezalel EladBezalel commented Apr 20, 2026

Summary

  • Fixes 9 collapsible_match clippy errors surfaced by Rust 1.95 in src/semantic/analyzer.rs
  • Adds rust-toolchain.toml pinned to 1.95 so future toolchain updates are intentional

Changes

src/semantic/analyzer.rs — purely mechanical transformations, no logic changes:

  • Converts if blocks inside match arms to match guards (if condition =>)
  • 2 fixes in find_namespace_references (lines 620, 635): lifted scalar equality checks into guards
  • 7 fixes in find_node_at_line walk-up loop (lines 980-1024): lifted !found_export_wrapper checks into guards

rust-toolchain.toml — new file:

[toolchain]
channel = "1.95"
components = ["clippy", "rustfmt"]

Pinning prevents surprise CI failures when Rust stable auto-bumps and introduces new lints. Future toolchain updates become intentional PRs.

Context

CI started failing on PRs #61 and #63 because dtolnay/rust-toolchain@stable picked up Rust 1.95 which promoted collapsible_match detection. The lint is deny via #![deny(clippy::all)] in src/lib.rs.

Test plan

  • All 181 unit tests pass
  • Clippy clean locally (1.91)
  • cargo fmt -- --check clean
  • Rust specialist verified all 9 changes are semantically equivalent

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Improved internal code organization patterns in the semantic analyzer.
  • Chores

    • Updated CI/CD toolchain configuration for development builds.

Rust 1.95's clippy flags 9 `collapsible_match` lints in analyzer.rs
where `if` blocks inside match arms can be expressed as match guards.
These are purely mechanical transformations — no logic changes.

Also adds rust-toolchain.toml pinned to 1.95 so future toolchain
updates are intentional rather than surprising CI with new lints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@EladBezalel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 28 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 19 minutes and 28 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 59213e8f-11da-4ce8-bdbb-2f2ef6960dac

📥 Commits

Reviewing files that changed from the base of the PR and between 0f8f959 and ad4f78f.

📒 Files selected for processing (2)
  • .github/workflows/CI.yml
  • rust-toolchain.toml
📝 Walkthrough

Walkthrough

This PR refactors control-flow patterns in the semantic analyzer to use Rust guard-match formatting instead of nested if blocks, maintaining identical functionality. Additionally, it updates the CI workflow to use a specific Rust toolchain version (1.95) instead of hardcoded stable.

Changes

Cohort / File(s) Summary
Semantic Analysis Refactoring
src/semantic/analyzer.rs
Rewrites conditional logic in find_namespace_member_access and find_node_at_line using guard-match arms (e.g., if property_name == ... becomes if ... =>) instead of nested if blocks; preserves all reference-tracking behavior and loop logic without functional changes.
CI Toolchain Configuration
.github/workflows/CI.yml
Introduces workflow environment variable RUST_TOOLCHAIN: '1.95' and updates dtolnay/rust-toolchain steps to reference this variable instead of hardcoded stable, centralizing Rust version management across lint and build jobs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Pattern guards hop into place,
Match arms embrace a cleaner face,
Toolchain pinned with steady care,
One-ninety-five, a version fair! 🔧

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: fixing clippy collapsible_match warnings and pinning the Rust toolchain version.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clippy-collapsible-match

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

EladBezalel and others added 2 commits April 20, 2026 12:58
rust-toolchain.toml conflicts with cross-compilation builds because
rustup switches to the pinned version after dtolnay/rust-toolchain
installs targets for a different version.

Pin the toolchain via RUST_TOOLCHAIN env var in CI.yml instead —
single place to update, no conflict with cross-compilation target
installation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restore rust-toolchain.toml so local clippy matches CI behavior.
Remove explicit toolchain: inputs from CI so dtolnay/rust-toolchain
reads the file and installs the pinned version with correct targets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@EladBezalel EladBezalel force-pushed the fix/clippy-collapsible-match branch from 3edc4f9 to 0bf7073 Compare April 20, 2026 10:02
Replace dtolnay/rust-toolchain action with plain rustup commands.
rustup natively reads rust-toolchain.toml and installs the pinned
toolchain + components — no parsing, no third-party action, works
on all platforms including Windows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@EladBezalel EladBezalel force-pushed the fix/clippy-collapsible-match branch from 5def042 to 6fde5ee Compare April 20, 2026 10:26
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

📦 Preview Release Available

A preview release has been published for commit ad4f78f.

Installation

npm install https://github.com/frontops-dev/domino/releases/download/pr-64-ad4f78f/front-ops-domino-1.2.1.tgz

Running the preview

npx https://github.com/frontops-dev/domino/releases/download/pr-64-ad4f78f/front-ops-domino-1.2.1.tgz affected

Details

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="rust-toolchain.toml">

<violation number="1" location="rust-toolchain.toml:2">
P3: Pin the full patch version here; `1.95` still tracks patch releases, so the toolchain can change without an intentional PR.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread rust-toolchain.toml Outdated
Pin to 1.95.0 instead of 1.95 so patch releases don't change the
toolchain without an intentional PR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@EladBezalel EladBezalel merged commit 0f0c958 into main Apr 20, 2026
24 checks passed
@EladBezalel EladBezalel deleted the fix/clippy-collapsible-match branch April 20, 2026 10:46
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