Skip to content

Commit

Permalink
Revert "allow nonminimal_bool until is_some_or is stabilized"
Browse files Browse the repository at this point in the history
This reverts commit b6a8653.
  • Loading branch information
wmmc88 committed Oct 6, 2024
1 parent b6a8653 commit aa7c9ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion crates/wdk-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ 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
Expand Down
11 changes: 1 addition & 10 deletions crates/wdk-build/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,21 +222,12 @@ 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<S: AsRef<str>>(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") {
if version_parts.first().is_none_or(|first| *first != "10") {
return false;
}

Expand Down

0 comments on commit aa7c9ce

Please sign in to comment.