Skip to content

Commit 3164f7d

Browse files
committed
add remove_and_create_dir_all in build_helper
1 parent 3876e7a commit 3164f7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/build_helper/src/fs/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,9 @@ where
8989
Err(e) => Err(e),
9090
}
9191
}
92+
93+
pub fn remove_and_create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
94+
let path = path.as_ref();
95+
recursive_remove(path)?;
96+
fs::create_dir_all(path)
97+
}

0 commit comments

Comments
 (0)