Implemented disallow_unknown

* Added codegen for disallow_unknown
* ... with new default to ignore unknown values during deserialization
* Added ContainerAttrs
This commit is contained in:
John Heitmann
2016-01-10 19:34:48 -08:00
parent 59285f627b
commit bfac1a581c
8 changed files with 366 additions and 10 deletions
+5 -1
View File
@@ -7,7 +7,7 @@ use num::rational::Ratio;
use serde::de::{Deserializer, Visitor};
use token::{Token, assert_de_tokens};
use token::{Error, Token, assert_de_tokens, assert_de_tokens_ignore};
//////////////////////////////////////////////////////////////////////////
@@ -39,7 +39,11 @@ macro_rules! declare_test {
#[test]
fn $name() {
$(
// Test ser/de roundtripping
assert_de_tokens(&$value, $tokens);
// Test that the tokens are ignorable
assert_de_tokens_ignore($tokens);
)+
}
}