Clean up a directory on error (e.g., failed clone). Silently removes the directory and all its contents. Does nothing if the path doesn't exist. # Arguments `path` - The directory to remove
(path: &Path)
| 645 | /// |
| 646 | /// * `path` - The directory to remove |
| 647 | pub fn cleanup_on_error(path: &Path) { |
| 648 | if path.exists() { |
| 649 | let _ = std::fs::remove_dir_all(path); |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | pub fn format_bytes(bytes: u64) -> String { |
| 654 | const KB: u64 = 1024; |