| 388 | } |
| 389 | |
| 390 | fn copy_dir(src: &Path, dst: &Path) { |
| 391 | for entry in WalkDir::new(src) { |
| 392 | let entry = entry.unwrap(); |
| 393 | let path = entry.path(); |
| 394 | if path.is_file() { |
| 395 | let relative_path = path.strip_prefix(src).unwrap(); |
| 396 | let target_path = dst.join(relative_path); |
| 397 | fs::create_dir_all(target_path.parent().unwrap()).unwrap(); |
| 398 | fs::copy(path, target_path).unwrap(); |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | fn compare_directories(dir1: &Path, dir2: &Path) { |
| 404 | for entry in WalkDir::new(dir1).into_iter().filter_map(|e| e.ok()) { |