Skip to content

Implement DerefMut for String, enabling make_ascii_*case #1157

Closed
@SimonSapin

Description

@SimonSapin

The AsciiExt trait has make_ascii_uppercase and make_ascii_lowercase methods that take &mut self. This trait is implemented for str, but there is currently no easy way to get a &mut str value.

&mut str is rarely useful, but ASCII case mapping is one of the rare cases. The intent (see rust-lang/rust#22024 (comment)) was that String would implement DerefMut, making these methods usable on it through deref to &mut str. But that last step has not been done yet. Is it time to do it? Is there a reason not to?

CC @alexcrichton @aturon

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