Use LazyLock for std environments and OnceBox for no_std#8630
Use LazyLock for std environments and OnceBox for no_std#8630ErichDonGubler merged 2 commits intogfx-rs:trunkfrom
Conversation
|
The "cleanest" way of ensuring that |
|
@FalkWoldmann: Yes, please! Filed #8701 for tracking. 🙂 |
ErichDonGubler
left a comment
There was a problem hiding this comment.
This code overall LGTM, but before I merge: What's the motivation for making this change? Is it to eliminate an unused dependency?
|
Just waiting for an answer to this comment before merging; friendly ping for @FalkWoldmann, in case this fell off the radar. |
|
Hi, yeah, sorry! Missed it :) the main motivation is to use the components which are already available via std to reduce the amount of external code that is run. However, we still bundle the dependency, so one could argue if this really changes a lot. I would say so, since I am of the opinion that the std features should always be preferred if they provide the features we need, which is the case here. |
42702fb to
ecce975
Compare
Description
Right now, we always use
once_cellinnaga, even whenstdwithLazyLockis available.Testing
I ran
cargo xtask testlocally.Squash or Rebase?
Rebase
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.