Skip to main content

collect_files

Function collect_files 

fn collect_files(
    directory: &Path,
    into: &mut Vec<PathBuf>,
    visited: &mut BTreeSet<PathBuf>,
) -> Result<(), Error>
Expand description

Every file under directory, skipping SKIPPED directory names.

Symbolic links are followed, to files and to directories alike. std::fs::DirEntry::file_type does not follow one, so a linked page or source file was neither is_dir() nor is_file() and fell out of the scan with no diagnostic — including out of the file count that is a green run’s only evidence it looked at anything (§1.3.106, §1.3.152). This tree has eleven such links: ten LICENSE-* files and crates/atune/examples, which is how cargo sees the examples G3 runs.

visited holds the canonical path of every directory already walked, which does two jobs at once: a link cycle terminates instead of hanging, and a directory reachable by two routes — crates/atune/examples is examples/rust — is walked once, so its citations are counted once.