Skip to content

Option and Result are missing documentation on their internal order #87238

Closed
@orlp

Description

@orlp

Option<T> where T: Ord implements Ord (and similarly for PartialOrd), but as far as I can see the order it uses isn't documented anywhere. You have to read the source to find out that its Ord implementation is derived, and that None comes before Some in the enum declaration thus None sorts before Some. I think that should be documented.

The same issue also appears to apply to Result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libsRelevant to the library 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