BurntSushi / walkdir

Rust library for walking directories recursively.
The Unlicense
1.21k stars 106 forks source link

Yield parent directory before reading it #188

Open fdiakh opened 8 months ago

fdiakh commented 8 months ago

I have a use case similar to #168 and stumbled upon the same issue. Here is an attempt at fixing it:

The first commit fixes the issue when using a non-sorted walkdir and doesn't change too much code (assuming I haven't missed anything ...)

The second commit fixes the issue when using a sorter as well and requires moving things around a bit more (feel free to drop this one if you'd rather merge a smaller change).

I also added a test case for the bug described in #168

Fixes: #168