typed-path 0.12.3

Provides typed variants of Path and PathBuf for Unix and Windows
Documentation
1
2
3
4
5
6
7
8
9
use typed_path::{Component, UnixPath};

fn main() {
    let path = UnixPath::new(r"/path/to/file.txt");

    for component in path.components() {
        println!("{}", String::from_utf8_lossy(component.as_bytes()));
    }
}