normalize
Cleans a path lexically: drops . components and folds .. into the component before it.
Nothing touches the file system, so this works for paths that do not exist, but symbolic
links are not resolved (use std::fs::canonicalize for that). A .. at the start of a
relative path is kept, a .. right after the root is dropped, and a path that cleans to
nothing becomes ..
Import
Section titled “Import”Cargo feature fs (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path | &Path | The path to clean. |
Returns
Section titled “Returns”PathBuf — The cleaned path.
