normalize

Function normalize 

Source
pub fn normalize(path: &Path) -> Result<PathBuf, NormalizeError>
Expand description

Normalize a path lexically, resolving . and .. without accessing the filesystem.

ยงErrors

Returns NormalizeError if the path attempts to traverse above its root.

Examples found in repository?
examples/normalize.rs (line 7)
4fn main() {
5    // Normalizing a path
6    let path = Path::new("foo/./bar/../baz");
7    let normalized = normalize(path).unwrap();
8    println!("Normalized path: {normalized:?}");
9}