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

Function changed_paths

perro_editor/res/scripts/assets/editor_file_watch.rs:18–42  ·  view source on GitHub ↗
(before: &[FileSig], after: &[FileSig])

Source from the content-addressed store, hash-verified

16 pub before: Vec<FileSig>,
17 pub next: Vec<FileSig>,
18 pub changed: Vec<String>,
19 pub res_paths: Vec<String>,
20}
21
22static PROJECT_SCAN_JOBS: OnceLock<Mutex<BTreeMap<String, ProjectScanJob>>> = OnceLock::new();
23
24pub fn request_project_scan(root: PathBuf, before: Vec<FileSig>) {
25 let key = root.to_string_lossy().to_string();
26 let jobs = PROJECT_SCAN_JOBS.get_or_init(|| Mutex::new(BTreeMap::new()));
27 let Ok(mut guard) = jobs.lock() else {
28 return;
29 };
30 let job = guard.entry(key.clone()).or_default();
31 if job.running || job.ready.is_some() {
32 return;
33 }
34 job.running = true;
35 drop(guard);
36
37 std::thread::spawn(move || {
38 let next = scan_project(&root);
39 let changed = changed_paths(&before, &next);
40 let res_paths = res_paths_from_sigs(&next);
41 let scan = ProjectScan {
42 before,
43 next,
44 changed,
45 res_paths,

Callers

nothing calls this directly

Calls 5

sig_pathFunction · 0.85
cloneMethod · 0.80
iterMethod · 0.45
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected