pub fn with_current_dir<F, R>(dir: &Path, f: F) -> Result<R>where F: FnOnce() -> Result<R>,
Temporarily changes the current working directory while executing a closure.