Skip to content

Docs: Arguments are described in the reverse order for map_or and map_or_else #84608

Closed
@lefth

Description

@lefth

Result and Option have map_or and map_or_else functions. In each case, the first parameter is used when the struct contains no value (or contains an error), while the second parameter is used when there is a value in the struct. The documentation mentions there parameters in the reverse order. This is confusing, as programmers expect parameter names to be documented in order.

I suggest reversing the wording.

I'll be submitting a PR with the change. If there are other classes or functions that have this issue, please leave a comment and I will change them as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions