Optimize the map builder macros (#1483)

This commit is contained in:
Kazantcev Andrey 2022-11-28 13:36:12 +03:00 committed by GitHub
parent 20cbbb203e
commit 3f26273128
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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),)+
])
}};
}