diff --git a/crates/wdk-build/Cargo.toml b/crates/wdk-build/Cargo.toml index ab8b4c538..ad92f32f4 100644 --- a/crates/wdk-build/Cargo.toml +++ b/crates/wdk-build/Cargo.toml @@ -22,6 +22,7 @@ clap = { workspace = true, features = ["derive"] } clap-cargo.workspace = true lazy_static.workspace = true paste.workspace = true +rustversion.workspace = true serde = { workspace = true, features = ["derive"] } serde_json.workspace = true thiserror.workspace = true diff --git a/crates/wdk-build/src/cargo_make.rs b/crates/wdk-build/src/cargo_make.rs index f5dea6fcd..26be9942b 100644 --- a/crates/wdk-build/src/cargo_make.rs +++ b/crates/wdk-build/src/cargo_make.rs @@ -396,7 +396,7 @@ impl ParseCargoArgs for CompilationOptions { ); } - configure_wdf_build_output_dir(target, &cargo_make_cargo_profile); + configure_wdf_build_output_dir(target.as_ref(), &cargo_make_cargo_profile); if let Some(timings_option) = &timings { timings_option.as_ref().map_or_else( @@ -1007,7 +1007,7 @@ pub fn package_driver_flow_condition_script() -> anyhow::Result<()> { }) } -fn configure_wdf_build_output_dir(target_arg: &Option, cargo_make_cargo_profile: &str) { +fn configure_wdf_build_output_dir(target_arg: Option<&String>, cargo_make_cargo_profile: &str) { let cargo_make_crate_custom_triple_target_directory = env::var(CARGO_MAKE_CRATE_CUSTOM_TRIPLE_TARGET_DIRECTORY_ENV_VAR).unwrap_or_else(|_| { panic!( diff --git a/crates/wdk-build/src/utils.rs b/crates/wdk-build/src/utils.rs index 3785ef17f..c8b6a3ee1 100644 --- a/crates/wdk-build/src/utils.rs +++ b/crates/wdk-build/src/utils.rs @@ -222,12 +222,21 @@ pub fn detect_cpu_architecture_in_build_script() -> CpuArchitecture { /// Validates that a given string matches the WDK version format (10.xxx.yyy.zzz /// where xxx, yyy, and zzz are numeric and not necessarily 3 digits long). +#[rustversion::attr( + nightly, + allow( + clippy::nonminimal_bool, + reason = "is_some_or is not stable until 1.82.0 is released on 10/17/24" + ) +)] pub fn validate_wdk_version_format>(version_string: S) -> bool { let version = version_string.as_ref(); let version_parts: Vec<&str> = version.split('.').collect(); // First, check if we have "10" as our first value if !version_parts.first().is_some_and(|first| *first == "10") { + // FIXME: Once is_some_or is stabilized, replace the above with: + // if version_parts.first().is_none_or(|first| *first != "10") { return false; }