Hi everyone.
Please help me to figure out how to solve the problem.
Ive got next:
use std::fs;
use std::env;
fn main() {
match fs::read_dir(env::current_dir().unwrap()) {
Err(st) => println!("{}", st.to_string()),
Ok(list) => for name in list {
if name.unwrap().path().is_dir(){
println!("{}", name.unwrap().path().display());}
}
}
}
if name.unwrap().path().is_dir(){
| ---- value moved here
8 | println!("{}", name.unwrap().path().display());}
| ^^^^ value used here after move
I understand that the value of name moves to if condition statement and i cant use it further, but how can i solve this problem?