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

`with_position` should yield tuples of unit enum and `Self::Item`. (Opinion.) #698

Closed johan-remarkable closed 1 year ago

johan-remarkable commented 1 year ago

Making Position have unit variants and having with_position yield (Self::Item, Position) seems like a more broadly useful interface. Why require matching or into_inner to get at the item? Intuitively, Position is "extra" information, so would make more sense to place it alongside IMHO.

Thanks for a great crate.

phimuemue commented 1 year ago

Hi there, I think that's the same as #651.

johan-remarkable commented 1 year ago

Yes, it's the same issue.

phimuemue commented 1 year ago

Closing, because we have #651.