-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
In the current implementation, Directory::iterate_dir accepts a callback to be executed for each entry. Returning an Iterator instead could make working with it much easier:
- It would match std::fs::read_dir behavior.
- It would make it possible to stop the iteration at any point.
- It's easy to convert iterators to callbacks (using
map
method) - It's hard to convert a callback into an iterator. Well, I don't currently see an easy way except pushing all entries from the callback into a vector, but that will require memory allocations.
Another well-known project to use iterators is embedded_graphics which proves that iterators are fast enough for use on embedded devices.
Metadata
Metadata
Assignees
Labels
No labels