Alright this looks handy: https://docs.rs/relative-path/latest/relative_path/ind...
cliffle @cliffle@hachyderm.io
Alright this looks handy: https://docs.rs/relative-path/latest/relative_path/index.html
This sort of replaces the Rust std path API with the thing I wish it had all along:
- A type distinction between paths that are absolute and relative
- Lexical normalization (ability to apply .. and friends)
- You can only interpret a path relative to some existing absolute root (which might be cwd, might not)
- Always UTF-8, which means you can easily do things that are comically difficult with std Path like detect if it contains whitespace.
Unlike std Path, you pay a conversion cost when you use the paths on Windows. So be it.