Function watchexec::paths::common_prefix
source · [−]pub fn common_prefix<I, P>(paths: I) -> Option<PathBuf> where
I: IntoIterator<Item = P>,
P: AsRef<Path>,
Expand description
Returns the longest common prefix of all given paths.
This is a utility function which is useful for finding the common root of a set of origins.
Returns None
if zero paths are given or paths share no common prefix.