Skip to content

Add examples for Ord and PartialOrd traits in std docs #15253

Closed
@mdinger

Description

@mdinger

Trait Ord and PartialOrd have cryptic explanations. An example would be helpful.

I thought these would be valid examples:

// [1,2,3,4,5,6] -> Ord - sortable without duplicates
// [B,C,D,a,c,e] -> Ord (used ASCII ordering)
// [1,1,1,2,3,3] -> PartialOrd - sortable with duplicates
// [A,B,B,c,c,c] -> PartialOrd

@steveklabnik You asked to be CCed on documentation bugs

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