fn clear_directory<P: AsRef<Path>>(directory: P) -> Result<(), Error>