(src: impl AsRef<Path>, dst: impl AsRef<Path>)
| 232 | Ok(()) |
| 233 | } |
| 234 | fn copy_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<()> { |
| 235 | fs::create_dir_all(&dst)?; |
| 236 | for src_entry in fs::read_dir(src)? { |
| 237 | let src_entry = src_entry?; |
| 238 | let dst_path = dst.as_ref().join(src_entry.file_name()); |
| 239 | let entry_type = src_entry.file_type()?; |
| 240 | if entry_type.is_dir() { |
| 241 | copy_dir_all(src_entry.path(), dst_path)?; |
| 242 | } else if entry_type.is_file() { |
| 243 | fs::copy(src_entry.path(), dst_path)?; |
| 244 | } |
| 245 | } |
| 246 | Ok(()) |
| 247 | } |
| 248 | |
| 249 | check_dir_all(&src, &dst)?; |
| 250 | copy_all(src, dst) |
no test coverage detected