BurntSushi/walkdir

[feature] Create a `try_filter_entry()`

Open

#131 opened on Nov 11, 2019

View on GitHub
 (5 comments) (0 reactions) (1 assignee)Rust (125 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (1,504 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I am using this library and have run into the need to capture a potential error inside of the filter_entry predicate. I asked in a forum topic about my problem and the response was that the best way to accomplish it would be with a try_filter_entry iterator so that I could return a result inside of the filter predicate.

I did a quick check of the source code to see how I might be able to implement that, but I was wondering if you might have any guidance on how you would want that implemented.

I haven't ever written an iterator before, but it looks like, if I wanted to create a FilterEntry iterator that it would be nearly identical to the existing TryFilterEntry iterator, but not quite the same.

Is there any way to share most of the implementation without duplicating code, or is it better just to create a copy of FilterEntry and the make the changes necessary.

Contributor guide