normalize_path

Function normalize_path 

Source
pub fn normalize_path(path: Cow<'_, Path>) -> Cow<'_, Path>
Expand description

Normalize all intermediate components of the path (ie. remove “./” and “../” components). Similar to fs::canonicalize() but doesn’t resolve symlinks.

Adapted from Cargo https://github.com/rust-lang/cargo/blob/af307a38c20a753ec60f0ad18be5abed3db3c9ac/src/cargo/util/paths.rs#L60-L85