Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use is_none_or for clippy::nonminimal_bool and resolve clippy::needless_raw_string_hashes #231

Merged
merged 6 commits into from
Nov 8, 2024

Conversation

wmmc88
Copy link
Collaborator

@wmmc88 wmmc88 commented Oct 7, 2024

This pull request includes a small refactor in the version validation function to satisfy new clippy lint triggers (clippy::nonminimal_bool, clippy::needless_raw_string_hashes), fixes to the winget installation action, and a minor formatting change in the wdk-sys build script. #230 silenced one instance of clippy::nonminimal_bool in nightly builds, since the solution required the nightly Option::is_none_or api. This PR removes the silencing and fixes the core issue.

Code Refactor:

  • Simplified the version validation logic by using the stabilized is_none_or method, replacing the previous workaround. (crates/wdk-build/src/utils.rs)

Winget Installation Script Update:

  • Updated the script to fetch and install Winget v1.8.1911 assets instead of the latest release, ensuring consistency in the installation process. (.github/actions/winget-install/action.yaml)
  • Added a step to install Winget for the current user to provide better installation diagnostics. (.github/actions/winget-install/action.yaml)

Formatting Change:

  • Fixed a minor formatting issue (clippy::needless_raw_string_hashes) in TEST_STUBS_TEMPLATE to improve code readability. (crates/wdk-sys/build.rs)

This PR cannot merge until Option::is_none_or is stabilized in rust 1.82.0 on 10/17/24.

@wmmc88 wmmc88 self-assigned this Oct 7, 2024
@wmmc88 wmmc88 assigned ayodejiige and unassigned wmmc88 Oct 14, 2024
@wmmc88 wmmc88 marked this pull request as ready for review October 19, 2024 23:48
ayodejiige
ayodejiige previously approved these changes Oct 21, 2024
NateD-MSFT
NateD-MSFT previously approved these changes Oct 22, 2024
@NateD-MSFT NateD-MSFT dismissed stale reviews from ayodejiige and themself via 0ed473c October 22, 2024 16:20
@NateD-MSFT
Copy link
Contributor

@wmmc88 Do you want to use this PR to fix the clippy::needless_raw_string_hashes issue as well just to clean everything up at once?

NateD-MSFT
NateD-MSFT previously approved these changes Oct 28, 2024
@wmmc88 wmmc88 marked this pull request as draft November 5, 2024 01:44
@wmmc88 wmmc88 force-pushed the stable-is-some-or-nonminimal-bool branch from 519b939 to de6177e Compare November 5, 2024 01:49
@wmmc88 wmmc88 marked this pull request as ready for review November 5, 2024 03:19
@wmmc88
Copy link
Collaborator Author

wmmc88 commented Nov 5, 2024

@wmmc88 Do you want to use this PR to fix the clippy::needless_raw_string_hashes issue as well just to clean everything up at once?

Fixed all the issues to unblock the pipeline

@wmmc88 wmmc88 changed the title refactor: use is_none_or for clippy::nonminimal_bool refactor: use is_none_or for clippy::nonminimal_bool and resolve clippy::needless_raw_string_hashes Nov 5, 2024
@wmmc88 wmmc88 enabled auto-merge November 5, 2024 03:26
@wmmc88 wmmc88 added this pull request to the merge queue Nov 7, 2024
Merged via the queue into microsoft:main with commit 4cb9626 Nov 8, 2024
62 checks passed
@wmmc88 wmmc88 deleted the stable-is-some-or-nonminimal-bool branch November 8, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants