~ireas/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH merge-rs 0/1] Hashmap feature proposal

Details
Message ID
<167504629070.6738.6508284466012378216-0@git.sr.ht>
DKIM signature
missing
Download raw message
Added function to recursively take elements in a hashmap only if the key
is present in `left` and `right`.

Gabouchet (1):
  feat(hashmap): Intersection

 src/lib.rs | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.34.5

[PATCH merge-rs 1/1] feat(hashmap): Intersection

Details
Message ID
<167504629070.6738.6508284466012378216-1@git.sr.ht>
In-Reply-To
<167504629070.6738.6508284466012378216-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Patch: +15 -0
From: Gabouchet <gabriel.hamel.pro@gmail.com>

---
 src/lib.rs | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/lib.rs b/src/lib.rs
index ab9b4ab..e289d84 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -298,4 +298,19 @@ pub mod hashmap {
            }
        }
    }

    /// Merge recursively elements if the key is present in `left` and `right`.
    pub fn intersection<K: Eq + Hash, V: crate::Merge>(
        left: &mut HashMap<K, V>,
        right: HashMap<K, V>,
    ) {
        use std::collections::hash_map::Entry;

        for (k, v) in right {
            match left.entry(k) {
                Entry::Occupied(mut existing) => existing.get_mut().merge(v),
                _ => {}
            }
        }
    }
}
-- 
2.34.5

[merge-rs/patches] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CQ56F4NSV76Y.HJYDNITSTUOD@cirno2>
In-Reply-To
<167504629070.6738.6508284466012378216-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
merge-rs/patches: FAILED in 3m4s

[Hashmap feature proposal][0] from [~gabouchet][1]

[0]: https://lists.sr.ht/~ireas/public-inbox/patches/38541
[1]: gabriel.hamel.pro@gmail.com

✗ #930882 FAILED merge-rs/patches/archlinux-msrv.yml https://builds.sr.ht/~ireas/job/930882
✗ #930883 FAILED merge-rs/patches/archlinux.yml      https://builds.sr.ht/~ireas/job/930883
Reply to thread Export thread (mbox)