Skip to content
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

Completely replace lazy_static with once_cell #168

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

tony-iqlusion
Copy link
Member

This eliminates all previous usages of lazy_static, including in the new application template, with an AppCell type which is based on OnceCell.

Unlike lazy_static, OnceCell does not require macros, and because of that can be hidden within the framework as an implementation detail.

It's also on track for potential inclusion in the standard library, which would allow us to eventually eliminate it as a dependency:

rust-lang/rfcs#2788

Overall, the previous usage patterns for lazy_static were hacking around the lack of a OnceCell-like API, so this is a net win.

This eliminates all previous usages of `lazy_static`, including in the
new application template, with an `AppCell` type which is based on
`OnceCell`.

Unlike `lazy_static`, `OnceCell` does not require macros, and because of
that can be hidden within the framework as an implementation detail.

It's also on track for potential inclusion in the standard library,
which would allow us to eventually eliminate it as a dependency:

rust-lang/rfcs#2788

Overall, the previous usage patterns for `lazy_static` were hacking
around the lack of a `OnceCell`-like API, so this is a net win.
@tarcieri tarcieri force-pushed the replace-lazy_static-with-once_cell-part-deux branch from 27cf02c to cb4ec93 Compare December 12, 2019 16:43
@tony-iqlusion tony-iqlusion merged commit 0111999 into develop Dec 12, 2019
@tony-iqlusion tony-iqlusion deleted the replace-lazy_static-with-once_cell-part-deux branch December 12, 2019 17:13
@tony-iqlusion tony-iqlusion mentioned this pull request Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant