I'm attempting to list all (non-directory) files recursively in a directory with the following code:
let entries = WalkDir::new("tests/expected_frames").into_iter();
let entries = entries.filter_entry(|entry| !entry.file_type().is_dir());
for entry in entries {
println!("{}", entry.unwrap().path().display());
}
The result is that nothing is printed (there would be some file paths printed if I had any in "expected_frames", but I only have sub-directories there). It seems that the code that is supposed to only remove directories from the resulting entries is also removing those directories from being recursed.
I'm attempting to list all (non-directory) files recursively in a directory with the following code:
The result is that nothing is printed (there would be some file paths printed if I had any in "expected_frames", but I only have sub-directories there). It seems that the code that is supposed to only remove directories from the resulting entries is also removing those directories from being recursed.
So this directory structure yields nothing:
While this directory structure yields the last two lines:
The workaround is to just not use filter_entry, using a regular filter instead:
I'm running on linux and this issue occurs for both walkdir 2.3.2 and 2.0.0.