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? |
daxpedda
left a comment
There was a problem hiding this comment.
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. |
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.