Merge pull request #2785 from Mingun/serialize_entry-in-flatten-newtype-variant

Use serialize_entry instead of serialize_key + serialize_value when serialize flatten newtype enum variant
This commit is contained in:
David Tolnay 2024-08-05 00:17:58 -07:00 committed by GitHub
commit e08c5de5dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1125,8 +1125,7 @@ where
where
T: ?Sized + Serialize,
{
tri!(self.0.serialize_key(variant));
self.0.serialize_value(value)
self.0.serialize_entry(variant, value)
}
fn serialize_seq(self, _: Option<usize>) -> Result<Self::SerializeSeq, Self::Error> {