-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bringing OsStr
and CStr
up to par with str
#900
Comments
It's not clear to me why we can't expose the underlying representation with some sort of cc @eddyb |
starts_with()
OsStr
and CStr
up to par with str
#1876 discusses some ideas for how slicing could work for |
See also:
|
For everyone still waiting on this issue, I created OsStr Bytes, which should make |
@dylni I realize you're intentionally invoking UB in that crate, but it's still UB and I therefore wouldn't recommend that approach: https://github.com/dylni/os_str_bytes/blob/ff8a9ed5e7d50b9ff63ea20bfd460a7f481340c1/src/windows.rs#L16-L28
|
@BurntSushi I completely agree and was hoping to hear some opinions on this, which is why I put it on the front page of the documentation. My plan is to come up with something better before a 1.0 release, but I haven't yet decided what the best option would be. However, I don't agree with the approach of not being able to handle some valid arguments on Windows, which is why I created the crate. I may just end up copying |
@BurntSushi That method is no longer called. |
About
? This way I won't have to handle |
Redirected from rust-lang/rust#22741
Using
starts_with()
as an example:Right now one can do this on OsStr by:
as_bytes()
, and a windows version usingencode_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.
The text was updated successfully, but these errors were encountered: