Function ethers_solc::utils::common_ancestor_all
source · pub fn common_ancestor_all<I, P>(paths: I) -> Option<PathBuf>where
I: IntoIterator<Item = P>,
P: AsRef<Path>,
Expand description
Find the common ancestor, if any, between the given paths
Example
use std::path::{PathBuf, Path};
use ethers_solc::utils::common_ancestor_all;
let baz = Path::new("/foo/bar/baz");
let bar = Path::new("/foo/bar/bar");
let foo = Path::new("/foo/bar/foo");
let common = common_ancestor_all(vec![baz, bar, foo]).unwrap();
assert_eq!(common, Path::new("/foo/bar").to_path_buf());