Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions app/src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ pub async fn start_scan(window: Window, roots: Vec<PathBuf>) -> Result<report::R

let progress_for_scan = progress.clone();
let result = tauri::async_runtime::spawn_blocking(move || {
let opts = scanner::ScanOptions { roots, ..Default::default() };
let opts = scanner::ScanOptions {
roots,
..Default::default()
};
let entries = scanner::scan(&opts, progress_for_scan).map_err(|e| e.to_string())?;
Ok::<_, String>(report::build(entries, &RulesDb::embedded()))
})
Expand Down Expand Up @@ -76,10 +79,13 @@ pub async fn quarantine_finding(
tauri::async_runtime::spawn_blocking(move || {
let (_, verdict, _) = RulesDb::embedded().classify(&path);
if matches!(verdict, Verdict::Protected | Verdict::Risky) {
return Err(format!("{} is classified {verdict:?}; action refused", path.display()));
return Err(format!(
"{} is classified {verdict:?}; action refused",
path.display()
));
}
actions::quarantine(&path, verdict, &quarantine_dir).map_err(|e| e.to_string())
})
.await
.map_err(|e| e.to_string())?
}
}
Loading