diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2023-09-12 19:32:46 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2023-09-12 19:33:41 +0200 |
| commit | a2ed508f547e5538ba6bd882ef76687aad06f4db (patch) | |
| tree | 818c369be998393969055a75042a1aadbac0480d /src | |
| parent | f17047bc9046b3e1218200c6b649ee59ac6d0a8d (diff) | |
| download | rust-a2ed508f547e5538ba6bd882ef76687aad06f4db.tar.gz rust-a2ed508f547e5538ba6bd882ef76687aad06f4db.zip | |
Fix `reset_directory` function
Before it was not deleting non-empty directories.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/opt-dist/src/utils/io.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/opt-dist/src/utils/io.rs b/src/tools/opt-dist/src/utils/io.rs index 8bd516fa349..d24a1dc2d10 100644 --- a/src/tools/opt-dist/src/utils/io.rs +++ b/src/tools/opt-dist/src/utils/io.rs @@ -7,7 +7,7 @@ use std::path::Path; /// Delete and re-create the directory. pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> { log::info!("Resetting directory {path}"); - let _ = std::fs::remove_dir(path); + let _ = std::fs::remove_dir_all(path); std::fs::create_dir_all(path)?; Ok(()) } |
