deserialize tuple enums with single element directly as the value instead of a sequence

This commit is contained in:
Oliver Schneider authored and Oliver Schneider committed 2015-07-24 09:10:58 +02:00
1 parent 447d08bd91
commit 5885111863
4 files changed
+91 -87

No files matched your search

+6
View File
@@ -555,6 +555,12 @@ fn deserialize_variant(
Ok($type_ident::$variant_ident)
})
}
ast::TupleVariantKind(ref args) if args.len() == 1 => {
quote_expr!(cx, {
let val = try!(visitor.visit_simple());
Ok($type_ident::$variant_ident(val))
})
}
ast::TupleVariantKind(ref args) => {
deserialize_tuple_variant(
cx,