pub fn normalize_lexical(path: &Path) -> PathBufExpand description
Lexically normalize a path (collapse ./.., no filesystem access).
SAFEST documented semantics, chosen deliberately over the drifting copies
this replaces: leading .. components are retained rather than silently
dropped (a/../../b normalizes to ../b, never b), so an input that
escapes its base stays visibly escapable instead of being quietly rewritten
into a different path. Mirrors the component cleanup git’s
strbuf_realpath_forgiving performs on the parts of a path that do not
exist on disk.