-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilterEntry::filter_entry has a suboptimal signature #130
Labels
Comments
Aye, yeah, this is unfortunate. I'll mark this for walkdir 3. (I started on walkdir 3 mid last year. The big change is jettisoning std's |
I just stumbled on this. The error is most newbie-unfriendly. Adding it here as google fodder:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This requires the
P
for thefilter_entry
to be the same as the one already applied. So this requires a second application offilter_entry
to use the same type as the first. This means it's not possible to callfilter_entry
on aWalkDir
twice with two different closures; instead, function pointers (or boxed closures) need to be used instead.I find it amusing it took so long to find this 😆 I guess 99.99% of use cases only need one filter. My workaround is to combine the two filters I was applying, though readability suffers for it.
The snippet in question
The better impl would give
FilterEntry::filter_entry
the same signature asIntoIter::filter_entry
:IIUC this is a "major breaking" change as someone could have used an empty turbofish (e.g.
let _: fn(_, fn(&_) -> _) -> _ = walkdir::FilterEntry::filter_entry::<>;
) to observe the lack of generic arguments.The text was updated successfully, but these errors were encountered: