-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove once_cell dependency #3520
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
Conversation
|
Didn't realize the type was in the public interface of the crate. Is this still acceptable as is? |
daxpedda
left a comment
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_cellis 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_cellis 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. |
daxpedda
left a comment
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!
notgull
left a comment
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.mdif knowledge of this change could be valuable to usersA follow up to #2313. Removes the
once_celldependency, instead usingstd::sync::OnceLockand a minimal polyfill forstd::sync::LazyLock, which may be stablized soon (see rust-lang/rust#121377).Should it be named
LazyLockto match up with the proposed API? I kept it asLazyfor now.This should not require a bump in MSRV, as
OnceLockwas stabilized in 1.70, which this crate is using.