From 3f262731280b84b4a246c99663bed5b5ba72f825 Mon Sep 17 00:00:00 2001 From: Kazantcev Andrey Date: Mon, 28 Nov 2022 13:36:12 +0300 Subject: [PATCH] Optimize the map builder macros (#1483) --- lib/src/mac/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/mac/mod.rs b/lib/src/mac/mod.rs index 5887410d..7ae6a647 100644 --- a/lib/src/mac/mod.rs +++ b/lib/src/mac/mod.rs @@ -6,9 +6,9 @@ macro_rules! bytes { macro_rules! map { ($($k:expr => $v:expr),* $(,)?) => {{ - let mut m = ::std::collections::BTreeMap::new(); - $(m.insert($k, $v);)+ - m + ::std::collections::BTreeMap::from([ + $(($k, $v),)+ + ]) }}; }