fix: resolve clippy collapsible_match warnings and pin toolchain#64
fix: resolve clippy collapsible_match warnings and pin toolchain#64EladBezalel merged 5 commits intomainfrom
Conversation
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>
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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>
3edc4f9 to
0bf7073
Compare
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>
5def042 to
6fde5ee
Compare
📦 Preview Release AvailableA preview release has been published for commit ad4f78f. Installationnpm install https://github.com/frontops-dev/domino/releases/download/pr-64-ad4f78f/front-ops-domino-1.2.1.tgzRunning the previewnpx https://github.com/frontops-dev/domino/releases/download/pr-64-ad4f78f/front-ops-domino-1.2.1.tgz affectedDetails |
There was a problem hiding this comment.
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.
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>
Summary
collapsible_matchclippy errors surfaced by Rust 1.95 insrc/semantic/analyzer.rsrust-toolchain.tomlpinned to 1.95 so future toolchain updates are intentionalChanges
src/semantic/analyzer.rs— purely mechanical transformations, no logic changes:ifblocks inside match arms to match guards (if condition =>)find_namespace_references(lines 620, 635): lifted scalar equality checks into guardsfind_node_at_linewalk-up loop (lines 980-1024): lifted!found_export_wrapperchecks into guardsrust-toolchain.toml— new file: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@stablepicked up Rust 1.95 which promotedcollapsible_matchdetection. The lint isdenyvia#![deny(clippy::all)]insrc/lib.rs.Test plan
cargo fmt -- --checkclean🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
Chores