rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.72k stars 309 forks source link

`TupleCombinations`: `size_hint` and `count` #763

Closed Philippe-Cholet closed 1 year ago

Philippe-Cholet commented 1 year ago

This was definitely simpler to implement than it was for Combinations (with vector items). The only difficulty is that it's recursive with a macro.

According to my notes, all iterators that should have a size_hint specialization now have. I like that.

The count_ident macro is moved to be available library-wide.

Philippe-Cholet commented 1 year ago

@jswrenn Ooops... I missed that checked_binomial in combinations.rs is behind the use_alloc feature. Where should I move it? In adaptors/mod.rs I guess as it seems to be the easiest move?

jswrenn commented 1 year ago

Yes, in adaptors/mod.rs is fine.