(path: &Path)
| 3949 | } |
| 3950 | |
| 3951 | fn remove_path_if_exists(path: &Path) -> Result<(), String> { |
| 3952 | let Ok(metadata) = fs::symlink_metadata(path) else { |
| 3953 | return Ok(()); |
| 3954 | }; |
| 3955 | if metadata.file_type().is_dir() { |
| 3956 | fs::remove_dir_all(path).map_err(|err| format!("remove {}: {err}", path.display())) |
| 3957 | } else { |
| 3958 | fs::remove_file(path).map_err(|err| format!("remove {}: {err}", path.display())) |
| 3959 | } |
| 3960 | } |
| 3961 | |
| 3962 | #[cfg(unix)] |
| 3963 | fn copy_symlink(source_path: &Path, dest_path: &Path) -> Result<(), String> { |
no outgoing calls
no test coverage detected