1 2 3 4 5 6 7 8 9
use typed_path::{Utf8Component, Utf8WindowsPath}; fn main() { let path = Utf8WindowsPath::new(r"C:\path\to\file.txt"); for component in path.components() { println!("{}", component.as_str()); } }