(sanitize_dir: &Path)
| 356 | } |
| 357 | |
| 358 | pub fn cleanup_sanitize_dir(sanitize_dir: &Path) -> Result<()> { |
| 359 | let files = crate::deopt::utils::read_sort_dir(sanitize_dir)?; |
| 360 | for file in files { |
| 361 | if let Some(ext) = file.extension() { |
| 362 | if ext == "log" || ext == "out" || ext == "cc" || ext == "profdata" || ext == "cost" |
| 363 | { |
| 364 | continue; |
| 365 | } |
| 366 | } |
| 367 | if file.is_dir() { |
| 368 | let _ = std::fs::remove_dir_all(file); |
| 369 | } else { |
| 370 | let _ = std::fs::remove_file(file); |
| 371 | } |
| 372 | } |
| 373 | Ok(()) |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | #[cfg(test)] |
no test coverage detected