mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 06:14:55 +00:00
Fix reset_directory
function
Before it was not deleting non-empty directories.
This commit is contained in:
parent
f17047bc90
commit
a2ed508f54
@ -7,7 +7,7 @@ use std::path::Path;
|
|||||||
/// Delete and re-create the directory.
|
/// Delete and re-create the directory.
|
||||||
pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> {
|
pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> {
|
||||||
log::info!("Resetting directory {path}");
|
log::info!("Resetting directory {path}");
|
||||||
let _ = std::fs::remove_dir(path);
|
let _ = std::fs::remove_dir_all(path);
|
||||||
std::fs::create_dir_all(path)?;
|
std::fs::create_dir_all(path)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user