Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Migrate from lazy_static to once_cell #448

Open
jaudiger opened this issue Jul 26, 2022 · 2 comments
Open

Migrate from lazy_static to once_cell #448

jaudiger opened this issue Jul 26, 2022 · 2 comments

Comments

@jaudiger
Copy link

lazy_static!, while a declarative macro, is a macro nonetheless. It can add quite a bit of additional compilation time cost. once_cell::sync::Lazy does the same thing with generics, and can be used more flexibly (i.e. non-static lazily initialized values), and has been proposed to be added to std: rust-lang/rfcs#2788.

Famous Rust projects already did the transition, such as:

@lucab
Copy link
Member

lucab commented Jul 26, 2022

Thanks for the report. Sounds like a good idea! I'll be happy to review a patch doing this if anybody wants to tackle it.

@jaudiger
Copy link
Author

Hi @lucab, thanks, I just opened a PR for it !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants