Function tmp_env::create_temp_dir [−][src]
pub fn create_temp_dir() -> Result<TmpDir, Error>
Expand description
Create a temporary directory in the temporary directory of your operating system
{ let tmp_dir = tmp_env::create_temp_dir().expect("cannot create temp dir"); // When tmp_dir is dropped this temporary dir will be removed assert!(std::fs::metadata(&*tmp_dir).is_ok()); } // The temporary directory is now removed