path_relative_to_cwd

Function path_relative_to_cwd 

Source
pub fn path_relative_to_cwd(path: &Path) -> Cow<'_, Path>
Expand description

Return path relative to current working directory.

// CWD = `/home/quentin/`
let file = Path::new("/home/quentin/docs/index.md");
assert_eq!(
    path_relative_to_cwd(file),
    Path::new("docs/index.md")
);