Skip to content
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

Option for breadth-first search? #16

Closed
lbonn opened this issue Dec 22, 2016 · 2 comments
Closed

Option for breadth-first search? #16

lbonn opened this issue Dec 22, 2016 · 2 comments

Comments

@lbonn
Copy link

lbonn commented Dec 22, 2016

In typical directory hierarchies, it's less efficient with a less predictable memory usage but it could be useful for streaming searches in huge directories.

Example: a fuzzy directory finder.

@BurntSushi
Copy link
Owner

This was how the original recursive directory iterator in std::fs worked, and a lot of people ran into problems with it for precisely that reason.

I'm not necessarily opposed to it, but I doubt it's as simple as "add an option for it." A simple option seems underwhelming compared to its impact: the entire implementation would need to change.

That means I'd like to see a breadth first iterator as a separate distinct type that implements the WalkDirIterator trait. Which itself raises some questions: do methods like skip_current_dir even make sense in a breadth first traversal? Can they be implemented efficiently?

I'm not personally inclined to work on this, but if there were a really clean way of adding it to this crate, then I think I'd be OK with it. My real preference though is for it to live in a separate crate.

@BurntSushi
Copy link
Owner

I'm going to close this. I'd like to see it prototyped in a separate crate first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants