use std::future::Future; pub fn with_dir(f: F) where F: Fn(tempdir::TempDir), { f(tempdir::TempDir::new_in("/tmp", "").unwrap()) } pub async fn with_dir_async(f: F) where FUT: Future, F: Fn(tempdir::TempDir) -> FUT, { f(tempdir::TempDir::new_in("/tmp", "").unwrap()).await }