BurntSushi / walkdir

Rust library for walking directories recursively.
The Unlicense
1.22k stars 107 forks source link

feat(dir_entry): Put is_dir() as a public function #97

Closed ElPicador closed 6 years ago

ElPicador commented 6 years ago

The purpose of this PR is to expose the DirEntry.is_dir() publicly. As it fixes a bug in the stdlib it should be public so lib users do not need to reimplement it.

BurntSushi commented 6 years ago

I'm not sure I agree. At least, not without a more careful story. The bug in the standard library has been fixed, so I think folks should either wait for that fix to propagate or work-around it by doing what walkdir does internally.

ElPicador commented 6 years ago

The story is simple, I'm lazy. Instead of doing

.filter_entry(|e| e.file_type().is_dir())

I would prefer to do:

.filter_entry(|e| e.is_dir())
BurntSushi commented 6 years ago

I don't find that argument compelling.

ElPicador commented 6 years ago

Too bad for my laziness 😄 Closing this them.