Skip to content

Feature request: into_group_btreemap #520

Open
@HollayHorvath

Description

@HollayHorvath

A BTreeMap version of the into_group* function group would be a nice addition.

The idea is that sometimes working with Hash is not feasible or even impossible, e.g. when you have to work with float-based datatypes as key or you would like to group your data by some custom criteria without wrapping the type and implementing custom Hash.

The into_group_btreemap() and into_group_btreemap_by() functions should work similarly how into_group_map() and into_group_btreemap_by() work, but would require K: Ord + Eq instead of K: Hash + Eq and would return BTreeMap<K, Vec<V>> instead of HashMap<K, Vec<V>>.

I have the code patched into my codebase, so I can also start a PR is this feature is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions