Function common_path::common_path
source · Expand description
Find the common prefix, if any, between 2 paths
Example
use std::path::{PathBuf, Path};
use common_path::common_path;
let baz = Path::new("/foo/bar/baz");
let quux = Path::new("/foo/bar/quux");
let prefix = common_path(baz, quux).unwrap();
assert_eq!(prefix, Path::new("/foo/bar").to_path_buf());