Closed MiguelX413 closed 10 months ago
Sidenote: CI only failed because of missing documentation (and missing new tests).
Hi. I'm still writing the CONTRIBUTING.md file in #767 but you might find its draft interesting.
I'm first wondering if it is useful enough to be integrated? Do you have an usecase example? Maybe it should be proposed to libcore first?
And what would be the alternative with the current iterator+itertools? For now, all I see is use "batching" (which is definitely not obvious and the size hint info would be lost).
iterator.peekable().batching(|it| it.next().map(|x| f(x, it.peek())))
(It makes me think of MapWindows<N=2> but different, and a bit of #771.)
EDIT: I think it could be PeekMap<I, F>
(no third type) by deleting F
constraint on PeekMap
definition.
I'll close this while https://github.com/rust-lang/rust/pull/118474 is in progress.
This is my first pull request to this project so I would appreciate feedback. I will add documentation soon.