3 ms·
> Rust has issues with String. Rust has 6 String types. String, Str, CString, Cstr, OsString, Ostr Absolutely spot on! You add Path, PathBuf & ffi into this mi
by sudeepj 7y ago
> Rust has issues with String. Rust has 6 String types. String, Str, CString, Cstr, OsString, Ostr
Absolutely spot on! You add Path, PathBuf & ffi into this mix, it becomes tiring very soon. I think a quality of life improvement is needed in this area.
- fiedzia 7y agoIts not a Rust problem, any project that mixes using string with passing them to C FFI and operating system API will need to handle those somehow differently. In Rust this is expressed with types and necessary checks/conversions are verified by compiler. In other languages its developer responsibility to deal with the problem of (sometimes subtle) differences, there is nothing here to fix really.
- sudeepj 7y ago> there is nothing here to fix really I get the rationale behind the need for different types. When I say quality of life improvement, I meant standard conversion functions between these types which would suffice for most of the use cases. Maybe a separate crate for this would be a good start.