summaryrefslogtreecommitdiffstats
path: root/tokio-fs/src/remove_dir.rs
blob: 853e60b2538ce32aac6fa1f9e615e55e66db2d0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::asyncify;

use std::io;
use std::path::Path;

/// Removes an existing, empty directory.
///
/// This is an async version of [`std::fs::remove_dir`][std]
///
/// [std]: https://doc.rust-lang.org/std/fs/fn.remove_dir.html
pub async fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
    let path = path.as_ref().to_owned();
    asyncify(move || std::fs::remove_dir(path)).await
}