sfackler/streaming-iterator

Wish: mapping methods that create a normal Iterator

Closed this issue · 4 comments

I find it strange that map and filter_map both create a StreamingIterator rather than an Iterator, because their mapped items are not tied to the lifetime of the source. You have to use cloned or owned after mapping to get an iterator by value.

Map and FilterMap could be plain Iterators that directly return the mapped value. One could still use convert to get back to streaming if really wanted. Also cloned and owned could essentially be just map(Clone::clone) and map(ToOwned::to_owned). Of course, this would be a breaking change.

Alternatively, there could be new methods like map_deref, just like map but producing an Iterator.

@sfackler Could you make a new release? There's been quite a bit since 0.1.4, including map_deref and filter_map_deref to resolve this issue.

@sfackler or perhaps add cuviper as co-owner/maintainer. He seems to be invested and active on this project.

I now have access to commit and publish -- 0.1.5 is out!