4 ms·
I've recently written a "system tool" in Rust, and, while it wasn't as bad, in terms of productivity, as I had imagined at first, there are certain domains wher
by pizza234 5y ago
I've recently written a "system tool" in Rust, and, while it wasn't as bad, in terms of productivity, as I had imagined at first, there are certain domains where Rust is really a grind.
Working with filenames/paths is one of those - if one works with (transforms) filenames/paths, the code will be polluted with all the conversions between PathBuf/Path/OsString/OsStr (and the canonical String/&str); this makes it hard to reason about the abstract logic.
It absolutely makes sense that Rust forces one to consider the robustness of the code, but in some cases one just doesn't want such robustness.
Cyclic graphs are another very ugly thing to work with in Rust (without supporting libraries).
- ______-_-______ 5y agoIf you don't care about robustness for paths with invalid utf-8, you could try camino https://crates.io/crates/camino https://crates.io/crates/camino
- pizza234 5y agoVery interesting! I'll actually check out if it fits my project. Thanks!
- WYepQ4dNnG 5y agoI agree with the string argument. I felt the same struggle, too many string types. It is hard to remember when to use what. I wish there were one string type to rule them all.