pub fn find_ancestor<'b, 'p>(base: &'b Path, path: &'p Path) -> Option<&'p Path> {
    let mut base_components = base.components();
    let mut path_components = path.components();

    let ancestors = {
        let mut ancestors = path.ancestors().collect::<Vec<_>>();
        ancestors.reverse();
        ancestors
    };

    loop {
        match base_components.next() {
            Some(Component::Prefix(base_prefix)) => match path_components.next() {