pub fn into_collapsed(path: impl Into<Utf8PathBuf>) -> Utf8PathBufExpand description
Collapses a path buffer without performing I/O.
- Resolves
../segments where possible. - Removes
./segments, except when leading - All redundant separators and up-level references are collapsed.
Example:
a/b/../cbecomesa/ca/../../cbecomes../c./somebecomes./some./some/./pathbecomes./some/path/a/../cbecomes/c/a/../../cbecomes/c
However, this does not resolve symbolic links.
It consumes the input Utf8PathBuf and returns a new one.