Optimize the map builder macros (#1483)
This commit is contained in:
parent
20cbbb203e
commit
3f26273128
1 changed files with 3 additions and 3 deletions
|
@ -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),)+
|
||||
])
|
||||
}};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue