add a JsonDeserializer, clean up tests

This commit is contained in:
Erick Tryzelaar
2014-05-28 10:46:29 -07:00
parent 88631b57cb
commit 86560857a7
4 changed files with 304 additions and 46 deletions
+2 -2
View File
@@ -223,13 +223,13 @@ mod deserializer {
match self.stack.pop() {
Some(AnimalState(Dog)) => {
self.stack.push(EndState);
Some(Ok(EnumStart("Animal", "Dog")))
Some(Ok(EnumStart("Animal", "Dog", 0)))
}
Some(AnimalState(Frog(x0, x1))) => {
self.stack.push(EndState);
self.stack.push(IntState(x1));
self.stack.push(StringState(x0));
Some(Ok(EnumStart("Animal", "Frog")))
Some(Ok(EnumStart("Animal", "Frog", 2)))
}
Some(IntState(x)) => {
Some(Ok(Int(x)))