Skip to main content

strip_common

Function strip_common 

Source
pub fn strip_common(base: &Path, path: &Path) -> String
Expand description

Returns the common parts of two paths.

The goal of this function is to reduce the path length based on the base argument (generally the path where the program is running into). For example:

current dir: /a/b/c
path:        /a/b/c/d/e.txt

strip_common will return d/e.txt.