about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2023-09-12 19:32:46 +0200
committerJakub Beránek <berykubik@gmail.com>2023-09-12 19:33:41 +0200
commita2ed508f547e5538ba6bd882ef76687aad06f4db (patch)
tree818c369be998393969055a75042a1aadbac0480d /src/tools
parentf17047bc9046b3e1218200c6b649ee59ac6d0a8d (diff)
downloadrust-a2ed508f547e5538ba6bd882ef76687aad06f4db.tar.gz
rust-a2ed508f547e5538ba6bd882ef76687aad06f4db.zip
Fix `reset_directory` function
Before it was not deleting non-empty directories.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/opt-dist/src/utils/io.rs2
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(())
 }