Expand description
Generates a random string of length “n”.
53
54
55
56
57
58
pub fn tmp_path(n: usize, sfx: Option<&str>) -> io::Result<String> {
let tmp_dir = env::temp_dir();
let tmp_file_path = tmp_dir.join(format!("{}{}", string(n), sfx.unwrap_or("")));
let tmp_file_path = tmp_file_path.as_os_str().to_str().unwrap();
Ok(String::from(tmp_file_path))
}