Function zng::task::fs::remove_dir

pub async fn remove_dir<P>(path: P) -> Result<(), Error>
where P: AsRef<Path>,
Expand description

Removes an empty directory.

Note that this function can only delete an empty directory. If you want to delete a directory and all of its contents, use remove_dir_all() instead.

§Errors

An error will be returned in the following situations:

  • path is not an existing and empty directory.
  • The current process lacks permissions to remove the directory.
  • Some other I/O error occurred.

§Examples

async_fs::remove_dir("./some/directory").await?;