Closed PeetoomHeida closed 3 years ago
The ?
operator in this case requires the code to be used in a function that returns a Result
.
Removing the ?
operator will still cause a compilation error due to:
no method named `path` found for enum `std::result::Result<walkdir::DirEntry, walkdir::Error>` in the current scope
method not found in `std::result::Result<walkdir::DirEntry, walkdir::Error>`rustc(E0599)
main.rs(4, 30): method not found in `std::result::Result<walkdir::DirEntry, walkdir::Error>`
The larger issue is that the code in the documentation will not run "out of the box" so to speak.
Trying to run code from the documentation fails to compile. The following code block comes from docs.rs:
Putting it into a simple program:
returns the following compilation error