typed/
typed.rs

1use typed_path::TypedPath;
2
3fn main() {
4    // Try to be smart to figure out the path (Unix or Windows) automatically
5    let path = TypedPath::derive(r"/path/to/file.txt");
6
7    for component in path.components() {
8        println!("{}", String::from_utf8_lossy(component.as_bytes()));
9    }
10}