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: Remove lazy static instances #250

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

leon-xd
Copy link

@leon-xd leon-xd commented Dec 4, 2024

Replaced lazy static instances with std::sync::LazyLock in following locations:

  • crates/wdk-build/src/lib.rs
  • crates/wdk-sys/build.rs
  • tests/wdk-macros-tests/src/lib.rs

Replaced lazy static instances with custom FunctionTable struct in generated code in crates/wdk-sys/build.rs

@wmmc88 wmmc88 requested review from Copilot, NateD-MSFT and wmmc88 and removed request for NateD-MSFT December 5, 2024 00:58

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 15 out of 17 changed files in this pull request and generated no suggestions.

Files not reviewed (2)
  • crates/wdk-sys/Cargo.toml: Evaluated as low risk
  • crates/wdk-build/Cargo.toml: Evaluated as low risk
crates/wdk-sys/build.rs Outdated Show resolved Hide resolved
crates/wdk-sys/build.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@wmmc88 wmmc88 changed the title chore: Remove lazy static instances refactor: Remove lazy static instances Dec 6, 2024
crates/wdk-build/src/lib.rs Show resolved Hide resolved
@@ -74,4 +74,4 @@ redundant_explicit_links = "warn"
unescaped_backticks = "warn"

[package.metadata.cargo-machete]
ignored = ["lazy_static"] # lazy_static is used in code generated by build.rs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep the comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this entire line is gone -- there's no reference to lazy_static. why do we need to keep the comment?

Cargo.toml Outdated Show resolved Hide resolved
crates/wdk-sys/build.rs Outdated Show resolved Hide resolved
crates/wdk-sys/build.rs Outdated Show resolved Hide resolved
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.

2 participants