Skip to content

Rename &str::as_bytes() to &str::as_utf8() #14131

Closed
@SimonSapin

Description

@SimonSapin

This seemed small enough to not be worth an RFC. Please correct me if it’s not.

Similar to how the str::from_bytes function was renamed to str::from_utf8, the &str::as_bytes method should be renamed to something that indicate UTF-8, possibly &str::as_utf8 or &str::as_utf8_bytes.

The &str::bytes and &str::bytes_rev iterators, the ~str::into_bytes method, and the StrBuf equivalent to all of the above should also be renamed accordingly.

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