Skip to content

Replace lazy_static with std::sync::OnceLock in nats-server#1298

Open
barafael wants to merge 2 commits into
nats-io:mainfrom
barafael:main
Open

Replace lazy_static with std::sync::OnceLock in nats-server#1298
barafael wants to merge 2 commits into
nats-io:mainfrom
barafael:main

Conversation

@barafael

@barafael barafael commented Aug 5, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@caspervonb caspervonb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for opening the pull request!

Previously we've replaced lazy_static with Lazy (e.g 70d34f6).

LazyCell just landed in v1.80, can we use that instead? (https://doc.rust-lang.org/std/cell/struct.LazyCell.html)

That'd apply to all the crates, probably removing both the dependency on once_cell and lazy_static.

cc @Jarema , we okay with bumping minimal to 1.8.x?

@Jarema

Jarema commented Sep 4, 2024

Copy link
Copy Markdown
Member

Honestly I would avoid bumping to the latest release without a good justification, and this does not look like one (however I like the idea of uzing LazyCell). Unless we bump it just for the server wrapper.

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.

3 participants