MCPcopy Create free account
hub / github.com/PerroEngine/Perro / collect_files

Function collect_files

perro_source/io_stack/perro_assets/src/walkdir.rs:22–37  ·  view source on GitHub ↗

Collect all files in a directory tree with their relative paths

(dir: &Path, base: &Path)

Source from the content-addressed store, hash-verified

20 let compiled = patterns
21 .iter()
22 .map(|pattern| CompiledPathPattern::new(pattern))
23 .collect();
24 let mut active = PATH_EXCLUSIONS.write().expect("path exclusion lock");
25 let previous = std::mem::replace(&mut *active, compiled);
26 PathExclusionGuard { previous }
27}
28
29impl Drop for PathExclusionGuard {
30 fn drop(&mut self) {
31 *PATH_EXCLUSIONS.write().expect("path exclusion lock") = std::mem::take(&mut self.previous);
32 }
33}
34
35/// Glob pattern with its `/`-segments split once at construction, so matching
36/// many paths (or one path against many patterns) skips the per-call split.
37#[derive(Clone, Debug)]
38pub struct CompiledPathPattern {
39 segments: Box<[Box<str>]>,
40}

Callers

nothing calls this directly

Calls 2

walk_dirFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected