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
+14
View File
@@ -2,6 +2,9 @@ use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::net;
use std::path::PathBuf;
extern crate fnv;
use self::fnv::FnvHasher;
use token::{
Error,
Token,
@@ -532,6 +535,17 @@ declare_tests! {
Token::StructStart("Anything", Some(0)),
Token::MapEnd,
],
hashmap![FnvHasher @ 1 => 2, 3 => 4] => vec![
Token::MapStart(Some(2)),
Token::MapSep,
Token::I32(1),
Token::I32(2),
Token::MapSep,
Token::I32(3),
Token::I32(4),
Token::MapEnd,
],
}
test_struct {
Struct { a: 1, b: 2, c: 0 } => vec![