Closed
Description
This is a tracking issue for the feature "option_insert".
The feature gate for the issue is #[unstable(feature = "option_insert")]
.
This feature adds a insert
method to any Option
, setting its value and returning a mutable reference to this value.
This method removes a cause of unwrap
and code complexity.
It allows replacing
option_value = Some(build());
option_value.as_mut().unwrap()
with
option_value.insert(build())
Steps / History
- Implementation: add
insert
toOption
#77392 - Decide on a name. Suggestions:
insert
(As in the original PR.)insert_and_get
replace
replace_and_get
set
- ...
- FCP
- Stabilization PR: Stabilize option_insert. #84088
Metadata
Metadata
Assignees
Labels
Area: Result and Option combinatorsCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.