refactor: fix collapsable_if lint, rust 1.95 assert_matches destabilization#643
refactor: fix collapsable_if lint, rust 1.95 assert_matches destabilization#643leon-xd merged 4 commits intomicrosoft:mainfrom
collapsable_if lint, rust 1.95 assert_matches destabilization#643Conversation
There was a problem hiding this comment.
Pull request overview
Updates wdk-build to satisfy newer Clippy’s collapsible_if lint by converting nested if let/if patterns into let-chains, unblocking CI lint runs.
Changes:
- Collapse a nested
if let+ifinCompilationOptions::parse_cargo_argsinto a single let-chain guard. - Collapse a nested
if let+ pattern match + equality check in bindgen callbacks into a single let-chain guard.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/wdk-build/src/cargo_make.rs | Converts the cargo-make “release profile vs forwarded --profile” conflict check into a let-chain form. |
| crates/wdk-build/src/bindgen.rs | Converts the WDF function table symbol rename override logic into a let-chain form. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #643 +/- ##
==========================================
+ Coverage 77.42% 77.47% +0.04%
==========================================
Files 24 24
Lines 4851 4848 -3
Branches 4851 4848 -3
==========================================
Hits 3756 3756
+ Misses 978 975 -3
Partials 117 117 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
if-let chains, assert_matches
if-let chains, assert_matchescollapsable_if lint, assert_matches destabilization
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wmmc88
left a comment
There was a problem hiding this comment.
the PR description is a little messy. can't quite pin down why it seems off. also i think this should be labelled refactor: fix xyz lint based off past lint fix prs
collapsable_if lint, assert_matches destabilizationcollapsable_if lint, rust 1.95 assert_matches destabilization
Fixes
collapsable_iflint failing in CI pipelines.The
assert_matchesstabilization that was expected to ship with Rust 1.95.0 was reverted from the 1.95 beta due to an inconsistency in temporary scoping behavior betweenassert_matches!/assert_eq!and theirdebug_variants.We gated
assert_matchesusage based on the nightly compiler warning that the feature was "stable since 1.95.0" (see #612). Since the stabilization was reverted before the actual release, this gate now fires on stable 1.95 and tries to use an unstable API, breaking CI pipelines.This bumps the gate to
1.96.0. Beta 1.96 currently still hasassert_matchesavailable, though that may change if the destabilization propagates.