MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / collect_sources

Function collect_sources

crates/os-runtime/build.rs:39–56  ·  view source on GitHub ↗
(dir: &Path, manifest_dir: &Path, out: &mut Vec<Source>)

Source from the content-addressed store, hash-verified

37 let path = entry.path();
38 if path.is_dir() {
39 watch_dir(&path);
40 } else {
41 println!("cargo:rerun-if-changed={}", path.display());
42 }
43 }
44}
45
46fn collect_sources(dir: &Path, manifest_dir: &Path, out: &mut Vec<Source>) {
47 let Ok(entries) = fs::read_dir(dir) else {
48 return;
49 };
50 for entry in entries.flatten() {
51 let path = entry.path();
52 if path.is_dir() {
53 collect_sources(&path, manifest_dir, out);
54 continue;
55 }
56 if path.extension().and_then(|ext| ext.to_str()) != Some("hll") {
57 continue;
58 }
59 let rel = path.strip_prefix(manifest_dir).expect("source under crate");

Callers 1

mainFunction · 0.85

Calls 3

source_keyFunction · 0.85
pathMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected