Skip to content

Tracking Issue for feature: "option_insert" #78271

Closed
@Canop

Description

@Canop

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-result-optionArea: Result and Option combinatorsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions