De/serialize for HashSet<T, S>

This commit is contained in:
David Tolnay
2016-06-11 09:59:29 -07:00
parent 322d7a90db
commit decc571988
5 changed files with 64 additions and 30 deletions
+8
View File
@@ -62,6 +62,14 @@ macro_rules! hashset {
$(set.insert($value);)+
set
}
};
($hasher:ident @ $($value:expr),+) => {
{
use std::hash::BuildHasherDefault;
let mut set = HashSet::with_hasher(BuildHasherDefault::<$hasher>::default());
$(set.insert($value);)+
set
}
}
}