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 std's OnceLock #486

Merged
merged 1 commit into from
Aug 17, 2024
Merged

Conversation

Liyixin95
Copy link
Contributor

The once_cell has been stable in std, and the 'lazy_static' is going to be deprecated, so it's better to use std's once_cell instead of lazy_static.

check detail at : rust-lang-nursery/lazy-static.rs#214

@Liyixin95 Liyixin95 requested review from a team as code owners August 16, 2024 02:42
@CLAassistant
Copy link

CLAassistant commented Aug 16, 2024

CLA assistant check
All committers have signed the CLA.

@Millione
Copy link
Member

How about using LazyLock?

@Liyixin95
Copy link
Contributor Author

How about using LazyLock?

LazyLock is newly introduced to std in 1.80. So using LazyLock will bump the msrv up to 1.80.

@Liyixin95
Copy link
Contributor Author

How about using LazyLock?

There are three choice:

  1. use OnceLock, which is little more verbose
  2. use std's LazyLock, which will bump up the msrv
  3. use the LazyLock in once_cell.

You maintainer can make a decision and I will follow.

@PureWhiteWu
Copy link
Member

Thanks very much for your contribution!
I think that using OnceLock seems really a little verbose, so maybe we can use LazyLock and bump the MSRV?
Bumping MSRV is not considered as a breaking change.

@Liyixin95
Copy link
Contributor Author

Thanks very much for your contribution! I think that using OnceLock seems really a little verbose, so maybe we can use LazyLock and bump the MSRV? Bumping MSRV is not considered as a breaking change.

done

@PureWhiteWu PureWhiteWu merged commit f790b2a into cloudwego:main Aug 17, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants