Skip to content

Forward more iterator methods for element iterators #555

@bluss

Description

@bluss

The Iter and IterMut are composed of a contiguous case and a general case, and because of this we should forward most (non-adaptor) methods to the underlying iterators. The existing fold and rfold methods serve as examples. No new custom implementations of the methods are needed in ElementsBase or Baseiter.

The ultimate ones to forward are try_fold and try_rfold, but they need to wait for having stable signatures (all traits in the signature).

Good ones to forward:

  • nth
  • collect
  • all, any
  • find, find_map

Some don't matter because they use fold that we already forward: count, max, min, max_by etc, sum, product

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions