Skip to content

Bringing OsStr and CStr up to par with str #900

@codyps

Description

@codyps

Redirected from rust-lang/rust#22741

Using starts_with() as an example:
Right now one can do this on OsStr by:

  • requiring the OsStr to be utf-8 (and converting it to str/String)
  • Or implimenting a unix version using as_bytes(), and a windows version using encode_wide()

Unfortunately, the lack of a common method for iteration over elements of the OsStr means that any out-of-std implimentation of these will be un-happily platform specific.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the RFC.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions