Skip to content

Requests: array multiway partition and flat_group_map #1078

@Pr0methean

Description

@Pr0methean

I currently have a pipeline that originally first called filter, then partition, but I've had to combine the two closures due to a borrow-checker issue. It would be nice if there was an easier way in such cases to avoid the overhead of either building a HashMap (that in this case only has 2 keys) in the flat_map().into_group_map() case, or tupling each item with a bool in the flat_map().partition() case. Why not have a method that would flatten an array of iterators from either an array of sub-iterators per input item, or a categorizing function that returns usize (or Option<usize> to simultaneously filter), or even from an Into<usize> element 0 of a 2-tuple but then having only element 1 as the output item?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions