Skip to content

Commit

Permalink
Fix tafia#567: use the correct deserializer when deserialize enum new…
Browse files Browse the repository at this point in the history
…type variant

The implementation of `VariantAccess::newtype_variant` should be the same as
`Deserializer::visit_newtype_struct`
  • Loading branch information
Mingun committed Oct 9, 2023
1 parent 1d2dbb8 commit 74cd272
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ MSRV bumped to 1.56! Crate now uses Rust 2021 edition.
- [#661]: More string handling of serialized primitive values (booleans, numbers, strings,
unit structs, unit variants). `<int>123<something-else/></int>` is no longer valid
content. Previously all data after `123` up to closing tag would be silently skipped.
- [#567]: Fixed incorrect deserialization of vectors of enums from sequences of tags.

### Misc Changes

Expand All @@ -40,6 +41,7 @@ MSRV bumped to 1.56! Crate now uses Rust 2021 edition.
- [#662]: Get rid of some allocations during serde deserialization.

[#545]: https://github.com/tafia/quick-xml/pull/545
[#567]: https://github.com/tafia/quick-xml/issues/567
[#580]: https://github.com/tafia/quick-xml/issues/580
[#619]: https://github.com/tafia/quick-xml/issues/619
[#635]: https://github.com/tafia/quick-xml/pull/635
Expand Down
4 changes: 2 additions & 2 deletions src/de/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ where
where
T: DeserializeSeed<'de>,
{
seed.deserialize(&mut *self.map.de)
seed.deserialize(self)
}

#[inline]
Expand Down Expand Up @@ -1170,7 +1170,7 @@ impl<'de> de::VariantAccess<'de> for TextDeserializer<'de> {
where
T: DeserializeSeed<'de>,
{
seed.deserialize(SimpleTypeDeserializer::from_text_content(self.0))
seed.deserialize(self)
}

#[inline]
Expand Down

0 comments on commit 74cd272

Please sign in to comment.