Skip to main content

normalize_root

Function normalize_root 

Source
pub fn normalize_root(directory: &str) -> String
Expand description

Normalize a directory argument the way str(Path(directory)) does (PurePosixPath semantics, PORT-CONTRACT.d/09 §1.6):

  • trailing slashes stripped (decisions/ -> decided)
  • leading ./ stripped (./decisions/ -> decided)
  • repeated slashes collapsed (decisions// -> decided), interior . removed (decisions/./x -> decisions/x)
  • .. preserved; absolute stays absolute
  • the empty / . argument normalizes to .