mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-26 06:40:42 +08:00
The file_system types, Label & Path, are overengineered. It's more natural to use the Path and PathBuf types provided by the std library. This replaces any mention of Label with String and any use of the old Path with either std::path::Path or std::path::PathBuf, depending on what kind of ownwership is needed. Anywhere a "root" directory is needed `PathBuf::new()` is used, i.e. an empty `PathBuf`. Otherwise `Path::new` can used to pass directory, or in fact a &str can also be used since it implements AsRef<Path>. The `File` and `Directory` types also contain there relative paths, which can be retrieved while traversing the Tree. Note the special file name `"special/faux\\path"` requires the use of an escaping string construction, i.e. `r"special/faux\\path"`. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett