matklad / once_cell

Rust library for single assignment cells and lazy statics without macros
Apache License 2.0
1.84k stars 110 forks source link

Covariant, compact sync::Lazy #234

Closed matklad closed 1 year ago

matklad commented 1 year ago

https://github.com/matklad/once_cell/pull/233 rewote unsync::Lazy to be convariant API-wise and have a smaller size_of. This required re-implementing OnceCell functionality, rather than delegating to it.

We should apply a similar treatment to sync module.

Special care should be taken to ensure we have all relevant tests. Before, we delegated most of unsafety to OnceCell, now we need to essentially repeat OnceCell test suite.