fn find_items(
    root: AbsolutePath,
    is_prefixed: &impl Fn(&Path) -> bool,
    active_prefixed_dirs: &HashSet<&Path>,
    excludes: &HashSet<&AbsolutePath>,
    res: &mut Vec<Item>,
) -> Result<(), Error> {
    for entry in root.read_dir()? {
        let entry = entry?;
        let path = AbsolutePath::from(entry.path());

        let entry_name = entry.file_name();
        let entry_name = Path::new(&entry_name);

        let excluded = excludes.contains(&path);
        if util::is_hidden(entry_name.as_os_str()) || excluded {
            if excluded {
                verbose_println!("Excluded {}", path);
            }
            continue;
        }

        if is_prefixed(&entry_name) {
            if active_prefixed_dirs.contains(entry_name) {
                find_items(path, is_prefixed, active_prefixed_dirs, excludes, res)?;
            }
        } else {
            let contents = link_dir_contents(&AbsolutePath::from(entry.path()), excludes)?;
            res.extend(contents);
        }
    }

    Ok(())
}
/// Finds the items under `path` which are to be symlinked, according to all the
/// options specified, and place then in `res`
Finds the items under `path` which are to be symlinked, according to all the
options specified, and place then in `res`
Finds the items under ` path ` which are to be symlinked according to all the options specified and place then in ` res `
fn find_items(
    root: AbsolutePath,
    is_prefixed: &impl Fn(&Path) -> bool,
    active_prefixed_dirs: &HashSet<&Path>,
    excludes: &HashSet<&AbsolutePath>,
    res: &mut Vec<Item>,
) -> Result<(), Error> {
    for entry in root.read_dir()? {
        let entry = entry?;
        let path = AbsolutePath::from(entry.path());
        let entry_name = entry.file_name();
        let entry_name = Path::new(&entry_name);
        let excluded = excludes.contains(&path);
        if util::is_hidden(entry_name.as_os_str()) || excluded {
            if excluded {
                verbose_println!("Excluded {}", path);
            }
            continue;
        }
        if is_prefixed(&entry_name) {
            if active_prefixed_dirs.contains(entry_name) {
                find_items(path, is_prefixed, active_prefixed_dirs, excludes, res)?;
            }
        } else {
            let contents = link_dir_contents(&AbsolutePath::from(entry.path()), excludes)?;
            res.extend(contents);
        }
    }
    Ok(())
}
fn find_items ( root : AbsolutePath , is_prefixed : & impl Fn ( & Path ) -> bool , active_prefixed_dirs : & HashSet < & Path > , excludes : & HashSet < & AbsolutePath > , res : & mut Vec < Item > , ) -> Result < ( ) , Error > { for entry in root . read_dir ( ) ? { let entry = entry ? ; let path = AbsolutePath :: from ( entry . path ( ) ) ; let entry_name = entry . file_name ( ) ; let entry_name = Path :: new ( & entry_name ) ; let excluded = excludes . contains ( & path ) ; if util :: is_hidden ( entry_name . as_os_str ( ) ) || excluded { if excluded { verbose_println ! ( " " path ) ; } continue ; } if is_prefixed ( & entry_name ) { if active_prefixed_dirs . contains ( entry_name ) { find_items ( path , is_prefixed , active_prefixed_dirs , excludes , res ) ? ; } } else { let contents = link_dir_contents ( & AbsolutePath :: from ( entry . path ( ) ) , excludes ) ? ; res . extend ( contents ) ; } } Ok ( ( ) ) }
Finds the items under `path` which are to be symlinked, according to all the
options specified, and place then in `res`
Finds the items under ` path ` which are to be symlinked according to all the options specified and place then in ` res `
root
AbsolutePath
is_prefixed
&impl Fn(&Path) -> bool
active_prefixed_dirs
&HashSet<&Path>
excludes
&HashSet<&AbsolutePath>
res
&mut Vec<Item>
root
AbsolutePath
is_prefixed
&impl Fn(&Path) -> bool
active_prefixed_dirs
&HashSet<&Path>
excludes
&HashSet<&AbsolutePath>
res
&mut Vec<Item>