itertools icon indicating copy to clipboard operation
itertools copied to clipboard

Introduce Itertools::owned() / Owned.

Open hadronized opened this issue 11 months ago • 2 comments

This is very similar to std’s Iterator::clone() / Cloned, but works on more types, such as CStr / CString.

hadronized avatar Jan 21 '25 11:01 hadronized

Is this essentially iterator.map(ToOwned.to_owned)?

If so:

  • We are reluctant to include even more "special-case map instances" (relevant discussion e.g. https://github.com/rust-itertools/itertools/pull/714#issuecomment-1963105704). I support these arguments and would prefer to not pull it into Itertools.
  • If someone else wants to merge, it should probably be implemented in terms of MapSpecialCase.

phimuemue avatar Jan 21 '25 12:01 phimuemue

Understood, I’ll wait for others to comment to decide what to do but I’m fine to close if you think it’s not a good fit.

hadronized avatar Jan 21 '25 16:01 hadronized