1use crate::fs::asyncify;
2
3use std::io;
4use std::path::Path;
5
6/// Removes a directory at this path, after removing all its contents. Use carefully!
7///
8/// This is an async version of [`std::fs::remove_dir_all`][std]
9///
10/// [std]: fn@std::fs::remove_dir_all
11pub async fn remove_dir_all(path: impl AsRef<Path>) -> io::Result<()> {
12 let path = path.as_ref().to_owned();
13 asyncify(move || std::fs::remove_dir_all(path)).await
14}
15