this post was submitted on 08 Jan 2022
22 points (100.0% liked)

Programmer Humor

32063 readers
1015 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] nutomic@lemmy.ml 2 points 2 years ago

Good explanation. However, OsString is not necessarily valid UTF-8/UTF-16 (in thay case, it could simply be String). The docs describe it pretty well.

https://doc.rust-lang.org/std/ffi/struct.OsString.html