You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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.