Closed jswrenn closed 8 months ago
I recently contributed about each of those points (except DoubleEndedIterator
) and there are key points I would have liked to know early on so I think I can help here. I'm starting a draft: https://github.com/Philippe-Cholet/itertools/compare/master...contributing
Mentorship welcomed.
EDIT: Markdown rendered here. I try to be as complete and precise but brief as possible.
tests/specializations.rs
definitely seems promising (I really like the Unspecialized
struct) but all apply some "closure" only on a fresh iterator and not on an iterator that has yielded elements. A buggy iterator could behave differently if those were applied later on.
I've experimented quite a bit (and eventually ditched macros, for sanity) to check size_hint/count/last/nth/fold/collect
(as most of our specialized methods are those) at every step of iteration (at the start and after every next
). And it works fine but is slower as you might expect, so I added the possibility to limit this to a few steps.
Usage (example) would remain nice but my implementation is definitely way more verbose (working branch: https://github.com/rust-itertools/itertools/compare/master...Philippe-Cholet:itertools:test-specializations).
Can you file a draft PR for CONTRIBUTING.md?
I'm very interested in seeing our specialization tests improved further!
Itertools needs a
CONTRIBUTING.md
. Key highlights should include:size_hint
.A complete guide should also address:
DoubleEndedIterator
ExactSizeIterator
FusedIterator
.(Anything else?)
Happy to provide mentorship on this.