I'm new to rust. I need to get a list of files and directories in a folder, however I can't access the iteration object more than once.
Of course, this can be done using else, but I would like to know what to do in such a situation.
for d in fs::read_dir("./").unwrap() {
if d.unwrap().path().is_dir() {
continue;
} else if d.unwrap().path().is_file() { //except here
continue;
}