I want to modify windows OsString in-place, without any memory allocation.
I know there are two functions make_ascii_lowercase()
and make_ascii_uppercase()
could do this, but I need some more complex, user-defined modifications. (I can promise this modification is safe and will not change its length)
The inner: Buf
in OsString is private, I can't get the mut ref of it; and encode_wide()
returns EncodeWide<'a>
without allocation, but it's just an Iterator
and I cannot modify it.