-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
OsStr
could implement a way to compare against prefix &str
(as it does not implement iterators over its data), similarly to how it implements comparison against &str
.
Currently you need to go out of your way to convert to bytes. as_str
is not suitable, as following case shows:
let x = /* OsStr with invalid utf8 */;
x.as_str().map(|x| x.starts_with("-")).unwrap_or(false); // false even if only the first byte really matters
sanmai-NL
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.