Extend test_internally_tagged_newtype_variant_containing_unit_struct to cover structs and seqs

This commit is contained in:
Mingun committed 2021-02-02 09:00:04 +05:00
1 parent 3257851192
commit b60c03ec3f
2 files changed
+21 -1

No files matched your search

+2 -1
View File
@@ -1287,8 +1287,9 @@ mod content {
// }
//
// We want {"topic":"Info"} to deserialize even though
// ordinarily unit structs do not deserialize from empty map.
// ordinarily unit structs do not deserialize from empty map/seq.
Content::Map(ref v) if v.is_empty() => visitor.visit_unit(),
Content::Seq(ref v) if v.is_empty() => visitor.visit_unit(),
_ => self.deserialize_any(visitor),
}
}