Skip to content

Is "must_use" really needed for Option::insert ? #130594

Open
@hardfist

Description

@hardfist

Related to #87196

I personally think insert is a more succinct and readable way than = Some(x) and this seems should be a style preference and don't get why it's marked as must_use.
what's more weird is Option::replace is not marked as must use, so the syntax is kind of inconsistent to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.T-langRelevant to the language team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions