pub fn normalize_root(v: &str) -> StringExpand description
Make sure root is normalized to style like /abc/def/.
ยงNormalize Rules
- All whitespace will be trimmed:
abc/def=>abc/def - All leading / will be trimmed:
///abc=>abc - Internal // will be replaced by /:
abc///def=>abc/def - Empty path will be
/: `` =>/ - Add leading
/if not starts with:abc/=>/abc/ - Add trailing
/if not ends with:/abc=>/abc/
Finally, we will get path like /path/to/root/.