1
2
3
4
5
6
7
8
9
10
use typed_path::Utf8TypedPath;

fn main() {
    // Try to be smart to figure out the path (Unix or Windows) automatically
    let path = Utf8TypedPath::derive(r"/path/to/file.txt");

    for component in path.components() {
        println!("{}", component.as_str());
    }
}