MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / find_removed_files

Function find_removed_files

src/sync.rs:131–144  ·  view source on GitHub ↗

Find files that are in the database but no longer exist on disk.

(db: &Database, current_files: &[String])

Source from the content-addressed store, hash-verified

129
130/// Find files that are in the database but no longer exist on disk.
131pub async fn find_removed_files(db: &Database, current_files: &[String]) -> Result<Vec<String>> {
132 let all_db_files = db.get_all_files().await?;
133 let current_set: std::collections::HashSet<&str> = current_files
134 .iter()
135 .map(std::string::String::as_str)
136 .collect();
137 let mut removed = Vec::new();
138 for file_record in &all_db_files {
139 if !current_set.contains(file_record.path.as_str()) {
140 removed.push(file_record.path.clone());
141 }
142 }
143 Ok(removed)
144}

Callers 1

test_find_removed_filesFunction · 0.85

Calls 5

collectMethod · 0.80
pushMethod · 0.80
get_all_filesMethod · 0.45
containsMethod · 0.45
as_strMethod · 0.45

Tested by 1

test_find_removed_filesFunction · 0.68