-
Notifications
You must be signed in to change notification settings - Fork 947
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
Remove once_cell dependency #3520
Conversation
Didn't realize the type was in the public interface of the crate. Is this still acceptable as is? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced there is sufficient motivation to do this as long as:
once_cell
is one of the most popular crates out there, e.g. our dependencies on Linux use it anyway, so removing it in Winit doesn't actually get rid of the dependency (on Linux).- Our manual implementation requires
unsafe
. once_cell
is a fairly small and well reviewed dependency.
It doesn't affect Web, so its up to the other maintainers.
I assume you mean because of all the CI failures? These things are not actually publicly exposed, they should rather be |
This really only is needed if the poly-fill is kept. The actual implementation isn't too bad if we replace every
Would it be OK to turn those into With that said, I'm happy to close this out for now and revisit this when |
I'd rather go with converting our current use of |
Agreed with moving away from OnceCell. |
I eliminated the unsafe at @notgull's suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
CHANGELOG.md
if knowledge of this change could be valuable to usersA follow up to #2313. Removes the
once_cell
dependency, instead usingstd::sync::OnceLock
and a minimal polyfill forstd::sync::LazyLock
, which may be stablized soon (see rust-lang/rust#121377).Should it be named
LazyLock
to match up with the proposed API? I kept it asLazy
for now.This should not require a bump in MSRV, as
OnceLock
was stabilized in 1.70, which this crate is using.