From 983a7b3f5c50076df4993e5fbf31794cac68ac78 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 4 Jul 2022 01:59:59 +0100 Subject: [PATCH] Add mrg! macro for merging Maps together --- src/mac/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mac/mod.rs b/src/mac/mod.rs index 85307b3d..8b157d3d 100644 --- a/src/mac/mod.rs +++ b/src/mac/mod.rs @@ -5,3 +5,10 @@ macro_rules! map { m }}; } + +macro_rules! mrg { + ($($m:expr, $x:expr)+) => {{ + $($m.extend($x.iter().map(|(k, v)| (k.clone(), v.clone())));)+ + $($m)+ + }}; +}