Closed SimplicityGuy closed 3 years ago
On https://docs.rs/walkdir/2.3.1/walkdir/, there is an example that is simply:
for entry in WalkDir::new(start) { println!("{}", entry?.path().display()); }
However, this fails to compile, giving the error:
13 | | println!("{}", entry?.path().display()); | | ^^^^^^ cannot use the `?` operator in a function that returns `()`
You need to use ? in a function that returns a Result.
?
Result
On https://docs.rs/walkdir/2.3.1/walkdir/, there is an example that is simply:
However, this fails to compile, giving the error: