-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Description
The standard library seems to assume calling make_ascii_uppercase() on the underlying [u8] is safe on Windows, seen here:
rust/src/libstd/sys/windows/process.rs
Lines 35 to 41 in 0eb878d
| impl From<OsString> for EnvKey { | |
| fn from(k: OsString) -> Self { | |
| let mut buf = k.into_inner().into_inner(); | |
| buf.make_ascii_uppercase(); | |
| EnvKey(FromInner::from_inner(FromInner::from_inner(buf))) | |
| } | |
| } |
Would it be reasonable to add a make_ascii_uppercase() and/or make_ascii_lowercase() to Windows OsStrExt and/or OsStringExt to make this available to users of std?
Even if the internal representation of OsString changes down the road, I would assume the code above would still need to be replicated with the new representation, so it seems like it should be okay to have make_ascii_uppercase a stable/public API.
If this is a reasonable request, I am willing to make a PR with the appropriate methods implemented in the appropriate places.