-
-
Notifications
You must be signed in to change notification settings - Fork 777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exhaustive internally tagged tests + support of internally tagged enums in non self-describing formats #2569
base: master
Are you sure you want to change the base?
Commits on Oct 22, 2024
-
Explain code in ContentDeserializer::deserialize_newtype_struct and a…
…dd comments about coverage
Configuration menu - View commit details
-
Copy full SHA for 397e871 - Browse repository at this point
Copy the full SHA 397e871View commit details -
Configuration menu - View commit details
-
Copy full SHA for 90564e6 - Browse repository at this point
Copy the full SHA 90564e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for a1e4ce7 - Browse repository at this point
Copy the full SHA a1e4ce7View commit details -
Remove confusing call to deserialize_untagged_variant in deserialize_…
…internally_tagged_variant deserialize_untagged_variant in that place is called when deserialzie_with attribute is set. In that case it performs special actions that is better to use explicitly in deserialize_untagged_variant for readability
Configuration menu - View commit details
-
Copy full SHA for 6929c5d - Browse repository at this point
Copy the full SHA 6929c5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ec5f590 - Browse repository at this point
Copy the full SHA ec5f590View commit details -
Configuration menu - View commit details
-
Copy full SHA for bcffa60 - Browse repository at this point
Copy the full SHA bcffa60View commit details -
Consistently use visit_content_seq and visit_content_map when deseria…
…lize enums Helper methods visit_content_[seq|map] does the same as [Seq|Map]Deserializer::deserialize_any and used everywhere except here. Reuse them for consistency
Configuration menu - View commit details
-
Copy full SHA for 5292da8 - Browse repository at this point
Copy the full SHA 5292da8View commit details -
Deserializer should not check correctness of data, this is the respon…
…sibility of the Visitor Examples of errors produced during deserialization of internally tagged enums in tests if instead of a Seq/Map a Str("unexpected string") will be provided: In tests/test_annotations.rs flatten::enum_::internally_tagged::tuple: before: `invalid type: string "unexpected string", expected tuple variant` after : `invalid type: string "unexpected string", expected tuple variant Enum::Tuple` flatten::enum_::internally_tagged::struct_from_map: before: `invalid type: string "unexpected string", expected struct variant` after : `invalid type: string "unexpected string", expected struct variant Enum::Struct`
Configuration menu - View commit details
-
Copy full SHA for 9009f63 - Browse repository at this point
Copy the full SHA 9009f63View commit details -
Store deserializer in Enum[Ref]Deserializer and Variant[Ref]Deseriali…
…zer directly That is cheap, creating a Content[Ref]Deserializer is a no-op
Configuration menu - View commit details
-
Copy full SHA for bf09ca4 - Browse repository at this point
Copy the full SHA bf09ca4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 020dace - Browse repository at this point
Copy the full SHA 020daceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 55e1c22 - Browse repository at this point
Copy the full SHA 55e1c22View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ba21c8 - Browse repository at this point
Copy the full SHA 2ba21c8View commit details -
Add support for internally tagged enums in non self-describing formats
Deserializer methods are only hints which deserializer is not obliged to follow. Both TaggedContentVisitor and InternallyTaggedUnitVisitor accepts only visit_map and visit_seq and that is what derived implementation of Deserialize does for structs. Therefore it is fine to call deserialize_map here, as that already did in derived deserialize implementation
Configuration menu - View commit details
-
Copy full SHA for 4c28350 - Browse repository at this point
Copy the full SHA 4c28350View commit details -
Add support for struct variants in untagged and adjacently tagged enu…
…ms in non self-describing formats Visitor passed to the deserialize_any supports only visit_map method, so we can always request deserialize_map
Configuration menu - View commit details
-
Copy full SHA for 72a7401 - Browse repository at this point
Copy the full SHA 72a7401View commit details -
Use deserialize_unit instead of deserialize_any for unit variants of …
…untagged and adjacently tagged enums
Configuration menu - View commit details
-
Copy full SHA for 9702ce1 - Browse repository at this point
Copy the full SHA 9702ce1View commit details