use std::io; use std::path::{Path, PathBuf}; use tempfile; #[allow(unused)] pub fn with_temp_path(f: F) -> io::Result where F: Fn(&Path) -> io::Result, { let dir = tempfile::tempdir()?; let path = PathBuf::from(dir.path()); f(path.as_ref()) }