Skip to content

Use std::sync::OnceLock instead of once_cell#281

Merged
djc merged 2 commits intoconsole-rs:mainfrom
cuviper:oncelock
Mar 12, 2026
Merged

Use std::sync::OnceLock instead of once_cell#281
djc merged 2 commits intoconsole-rs:mainfrom
cuviper:oncelock

Conversation

@cuviper
Copy link
Contributor

@cuviper cuviper commented Mar 12, 2026

OnceLock was stabilized in Rust 1.70, so this is usable in console
now that its MSRV is 1.71, and thus once_cell can be dropped.

This would be closer to the original code if we could use 1.80's
LazyLock, but function wrappers here can still achieve a similar kind
of abstraction around the lazy initialization.

`OnceLock` was stabilized in Rust 1.70, so this is usable in `console`
now that its MSRV is 1.71, and thus `once_cell` can be dropped.

This would be closer to the original code if we could use 1.80's
`LazyLock`, but function wrappers here can still achieve a similar kind
of abstraction around the lazy initialization.
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

Thanks!

Hmm, I do kind of hate the OnceLock API compared to LazyLock. Oh well, I guess we'll get to it in a year or so.

@djc djc merged commit 6bd8894 into console-rs:main Mar 12, 2026
20 checks passed
@djc
Copy link
Member

djc commented Mar 12, 2026

If you want a release, mind submitting a version bump PR?

kodiakhq bot pushed a commit to pdylanross/fatigue that referenced this pull request Mar 16, 2026
Bumps console from 0.16.2 to 0.16.3.

Release notes
Sourced from console's releases.

0.16.3
What's Changed

Use std::sync::OnceLock instead of once_cell by @​cuviper in console-rs/console#281
Bump version to 0.16.3 by @​cuviper in console-rs/console#282




Commits

70ea3d0 Bump version to 0.16.3
6bd8894 Remove make msrv-lock
499e5f6 Use std::sync::OnceLock instead of once_cell
See full diff in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
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.

2 participants