Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust `String`s are always UTF-8 – distinct from `OsString`s which are not. Conversions are explicit, and the programmer is often forced to decide between conversions which are a) fallible or b) lossy. If neither choice is appropriate, the only option is to avoid the conversion, which… is correct.

https://doc.rust-lang.org/std/string/struct.String.html

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

https://doc.rust-lang.org/std/path/struct.PathBuf.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: