(source: &Path, destination: &Path)
| 9442 | } |
| 9443 | |
| 9444 | fn copy_file(source: &Path, destination: &Path) -> Result<()> { |
| 9445 | ensure_file(source)?; |
| 9446 | if let Some(parent) = destination.parent() { |
| 9447 | fs::create_dir_all(parent).with_context(|| format!("create {}", parent.display()))?; |
| 9448 | } |
| 9449 | fs::copy(source, destination) |
| 9450 | .with_context(|| format!("copy {} -> {}", source.display(), destination.display()))?; |
| 9451 | Ok(()) |
| 9452 | } |
| 9453 | |
| 9454 | fn copy_dir_all(source: &Path, destination: &Path) -> Result<()> { |
| 9455 | if destination.exists() { |
no test coverage detected