De/serialize for HashMap<K, V, S>

This commit is contained in:
David Tolnay
2016-06-11 00:43:02 -07:00
parent 84a573c926
commit 46a1860601
6 changed files with 62 additions and 31 deletions
+8
View File
@@ -75,5 +75,13 @@ macro_rules! hashmap {
$(map.insert($key, $value);)+
map
}
};
($hasher:ident @ $($key:expr => $value:expr),+) => {
{
use std::hash::BuildHasherDefault;
let mut map = HashMap::with_hasher(BuildHasherDefault::<$hasher>::default());
$(map.insert($key, $value);)+
map
}
}
}