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

Function collect_file_paths

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

Collect file paths only (no data)

(dir: &Path, base: &Path)

Source from the content-addressed store, hash-verified

38pub struct CompiledPathPattern {
39 segments: Box<[Box<str>]>,
40}
41
42impl CompiledPathPattern {
43 pub fn new(pattern: &str) -> Self {
44 Self {
45 segments: pattern.split('/').map(Box::from).collect(),
46 }
47 }
48
49 /// Match against a path already split into `/` segments
50 /// (see [`split_path_segments`]).
51 pub fn matches_segments(&self, path: &[&str]) -> bool {
52 match_segments(&self.segments, path)
53 }
54
55 pub fn matches_path(&self, path: &str) -> bool {
56 self.matches_segments(&path.split('/').collect::<Vec<_>>())
57 }

Callers 1

Calls 2

walk_dirFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected