I am consider how to do this.Should I use fllowing code try all letter,or is there a convenient api somewhere?
let mut letter = vec!["A:\\", "B:\\", "C:\\", "D:\\",".....","Z:\\"];
let mut exit_letter_vec = vec![];
for x in letter {
let path = Path::new(x);
if path.exists() {
exit_letter_vec.push(path);
}
}
for x in exit_letter_vec {
println!("{:?}", x.as_os_str());
}