Skip to content

impl PartialOrd<str> for String #82990

Open
@tmandry

Description

@tmandry
    let a = "a".to_string();
    // compiles
    println!("{}", "b" > &a);
    // doesn't compile
    // println!("{}", &a < "b");

We have impl PartialEq<str> for String and impl PartialEq<&str> for String, but no matching impls for PartialOrd. Can we add these impls to round it out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-strArea: str and StringC-enhancementCategory: An issue proposing an enhancement or a PR with one.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