From f7cc5cb7357f18dadfd9dd950f4a7863311185c5 Mon Sep 17 00:00:00 2001 From: leon-xd Date: Thu, 16 Apr 2026 11:16:53 -0700 Subject: [PATCH 1/4] fix: collapse nested if-let chains for new clippy lint --- crates/wdk-build/src/bindgen.rs | 12 +++++------- crates/wdk-build/src/cargo_make.rs | 16 ++++++++-------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/crates/wdk-build/src/bindgen.rs b/crates/wdk-build/src/bindgen.rs index f815cd5c6..06120621a 100644 --- a/crates/wdk-build/src/bindgen.rs +++ b/crates/wdk-build/src/bindgen.rs @@ -159,17 +159,15 @@ impl BuilderExt for Builder { impl ParseCallbacks for WdkCallbacks { fn generated_name_override(&self, item_info: ItemInfo) -> Option { // Override the generated name for the WDF function table symbol, since bindgen is unable to currently translate the #define automatically: https://github.com/rust-lang/rust-bindgen/issues/2544 - if let Some(wdf_function_table_symbol_name) = &self.wdf_function_table_symbol_name { - if let ItemInfo { + if let Some(wdf_function_table_symbol_name) = &self.wdf_function_table_symbol_name + && let ItemInfo { name: item_name, kind: ItemKind::Var, .. } = item_info - { - if item_name == wdf_function_table_symbol_name { - return Some("WdfFunctions".to_string()); - } - } + && item_name == wdf_function_table_symbol_name + { + return Some("WdfFunctions".to_string()); } None } diff --git a/crates/wdk-build/src/cargo_make.rs b/crates/wdk-build/src/cargo_make.rs index 572081f72..64e3f18f3 100644 --- a/crates/wdk-build/src/cargo_make.rs +++ b/crates/wdk-build/src/cargo_make.rs @@ -337,14 +337,14 @@ impl ParseCargoArgs for CompilationOptions { { "release" => { // cargo-make release profile sets the `--profile release` flag - if let Some(profile) = &profile { - if profile != "release" { - eprintln!( - "Specifying `--profile release` for cargo-make conflicts with the \ - setting `--profile {profile}` to forward to tasks" - ); - std::process::exit(CLAP_USAGE_EXIT_CODE); - } + if let Some(profile) = &profile + && profile != "release" + { + eprintln!( + "Specifying `--profile release` for cargo-make conflicts with the setting \ + `--profile {profile}` to forward to tasks" + ); + std::process::exit(CLAP_USAGE_EXIT_CODE); } append_to_space_delimited_env_var( From 548fecc507c1b651b4dbf490d4bcfb1b03c187f1 Mon Sep 17 00:00:00 2001 From: leon-xd Date: Thu, 16 Apr 2026 13:09:23 -0700 Subject: [PATCH 2/4] fix: bump assert_matches gate to 1.96 (stabilization reverted from 1.95 beta) --- crates/wdk-build/build.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/wdk-build/build.rs b/crates/wdk-build/build.rs index ab3815055..5ab11de37 100644 --- a/crates/wdk-build/build.rs +++ b/crates/wdk-build/build.rs @@ -14,11 +14,12 @@ fn main() { // Custom attributes cannot be applied to expressions yet, so separate functions // are required for `rustversion` conditional compilation: https://github.com/rust-lang/rust/issues/15701 // TODO: Remove the `setup_assert_matches_stabilized_cfg` feature and related -// code once the minimum supported Rust version is 1.95.0 or later. -#[rustversion::since(1.95.0)] +// code once the minimum supported Rust version includes stable `assert_matches`. +// Stabilization was reverted from 1.95.0 beta: https://github.com/rust-lang/rust/pull/154999 +#[rustversion::since(1.96.0)] fn setup_assert_matches_stabilized_cfg() { println!("cargo::rustc-cfg=assert_matches_stabilized"); } -#[rustversion::before(1.95.0)] +#[rustversion::before(1.96.0)] const fn setup_assert_matches_stabilized_cfg() {} From 9d31751088d4389ce734930eb943ce16bedaf808 Mon Sep 17 00:00:00 2001 From: leon-xd Date: Thu, 16 Apr 2026 13:19:29 -0700 Subject: [PATCH 3/4] style: reformat build.rs comment for nightly rustfmt --- crates/wdk-build/build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/wdk-build/build.rs b/crates/wdk-build/build.rs index 5ab11de37..9c3080228 100644 --- a/crates/wdk-build/build.rs +++ b/crates/wdk-build/build.rs @@ -14,8 +14,9 @@ fn main() { // Custom attributes cannot be applied to expressions yet, so separate functions // are required for `rustversion` conditional compilation: https://github.com/rust-lang/rust/issues/15701 // TODO: Remove the `setup_assert_matches_stabilized_cfg` feature and related -// code once the minimum supported Rust version includes stable `assert_matches`. -// Stabilization was reverted from 1.95.0 beta: https://github.com/rust-lang/rust/pull/154999 +// code once the minimum supported Rust version includes stable +// `assert_matches`. Stabilization was reverted from 1.95.0 beta: +// https://github.com/rust-lang/rust/pull/154999 #[rustversion::since(1.96.0)] fn setup_assert_matches_stabilized_cfg() { println!("cargo::rustc-cfg=assert_matches_stabilized"); From 50a5d6c5787b65640efd07ff63219abe62a2d59e Mon Sep 17 00:00:00 2001 From: leon-xd Date: Thu, 16 Apr 2026 13:28:40 -0700 Subject: [PATCH 4/4] fix: link to tracking issue instead of revert PR in build.rs comment --- crates/wdk-build/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/wdk-build/build.rs b/crates/wdk-build/build.rs index 9c3080228..1163017d5 100644 --- a/crates/wdk-build/build.rs +++ b/crates/wdk-build/build.rs @@ -15,8 +15,8 @@ fn main() { // are required for `rustversion` conditional compilation: https://github.com/rust-lang/rust/issues/15701 // TODO: Remove the `setup_assert_matches_stabilized_cfg` feature and related // code once the minimum supported Rust version includes stable -// `assert_matches`. Stabilization was reverted from 1.95.0 beta: -// https://github.com/rust-lang/rust/pull/154999 +// `assert_matches`. Tracking issue: +// https://github.com/rust-lang/rust/issues/82775 #[rustversion::since(1.96.0)] fn setup_assert_matches_stabilized_cfg() { println!("cargo::rustc-cfg=assert_matches_stabilized");