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

Server: Replace lazy static with once cell everywhere #1024

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

svix-nick
Copy link
Contributor

Motivation

The lazy_static crate has not received maintenance in about four years, and has generally been deprecated in favor of once_cell. The latter's interface is being incorporated into the standard library.

Solution

This PR simply swaps out lazy_static macro invocations for once_cell's Lazy interface.

@svix-nick
Copy link
Contributor Author

Open source review:
once_cell is the new standard for lazily-initialized static values. The intent is for its API to be incorporated into the standard library. Parts of it already have been as of Rust 1.70.0.

Our existing solution lazy_static is not maintained, and urges users to move to once_cell.

once_cell is dual licensed Apache 2.0 and MIT, as are all of its dependencies.

@svix-nick svix-nick requested a review from tasn July 26, 2023 00:15
@svix-nick svix-nick force-pushed the nick/once-lazy-cell-static branch from 9331ea6 to eafae9c Compare July 26, 2023 15:08
@tasn
Copy link
Member

tasn commented Jul 26, 2023

Looks good to me!

@tasn tasn merged commit 827c944 into main Jul 26, 2023
@tasn tasn deleted the nick/once-lazy-cell-static branch July 26, 2023 15:54
@svix-nick svix-nick self-assigned this Jul 28, 2023
svix-nick added a commit that referenced this pull request Aug 24, 2023
See also #1024 

lazy_static is unmaintained, once_cell is the new hotness. This PR swaps
out the one lazy_static invocation for the equivalent lazy construct
from once_cell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants