-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(once_cell_get_mut)]
This is a tracking issue for
OnceCell::get_mut_or_init()
OnceCell::get_mut_or_try_init()
OnceLock::get_mut_or_init()
OnceLock::get_mut_or_try_init()
Public API
pub fn get_mut_or_try_init<F, E>(&mut self, f: F) -> Result<&mut T, E>
where
F: FnOnce() -> Result<T, E> { ... }
pub fn get_mut_or_init<F>(&mut self, f: F) -> &mut T
where
F: FnOnce() -> T { ... }
Steps / History
- ACP: Add get_mut_or_init and get_mut_or_try_init for OnceCell libs-team#294
- Implementation: impl get_mut_or_init and get_mut_or_try_init for OnceCell and OnceLock #114788
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
None yet.
Footnotes
thynson, B0ney, LennyLizowzskiy, bergkvist, Scripter17 and 4 morethynson
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.