Skip to content

Tracking Issue for BTreeMap::merge #152152

@asder8215

Description

@asder8215

Feature gate: #![feature(btree_merge)]

This is a tracking issue for rust-lang/libs-team#739

It adds a method similar to BTreeMap::append with merging two BTreeMaps in O(n + m) complexity, but allows the user to specify a callback function to handle what the resulting value should be for conflicting keys.

Public API

// use std::collections::BTreeMap; or use alloc::collections::btree_map; 

impl <K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
    pub fn merge(&mut self, other: BTreeMap<K, V, A>, conflict: impl FnMut(&K, V, V) -> V) { ... }
}

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions