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

Replace lazy_static with once_cell #298

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

nvzqz
Copy link
Contributor

@nvzqz nvzqz commented Jun 1, 2023

The ecosystem has generally accepted that the approach used in once_cell is a better way to lazily initialize statics.

This change also makes it easier to later use std::sync::LazyLock. See rust-lang/rust#109736.

The ecosystem has generally accepted that the approach used in
`once_cell` is a better way to lazily initialize statics.

This change also makes it easier to later use `std::sync::LazyLock`. See
rust-lang/rust#109736.
Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at some of this code in ages. It's always embarrassing to look back at old code and be like "what was I thinking, did I not know anything..?" 😅

Thanks!

@obi1kenobi obi1kenobi enabled auto-merge (squash) June 1, 2023 18:53
@nvzqz
Copy link
Contributor Author

nvzqz commented Jun 1, 2023

FWIW, I don't think once_cell was in common use or at 1.0 back when this code was first written. Also, many projects haven't yet moved past lazy_static.

@obi1kenobi obi1kenobi merged commit 00d3b8c into obi1kenobi:main Jun 1, 2023
12 checks passed
@nvzqz nvzqz deleted the pr/replace-lazy_static branch June 1, 2023 19:02
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

2 participants