Skip to content

Commit

Permalink
Merge pull request #2785 from Mingun/serialize_entry-in-flatten-newty…
Browse files Browse the repository at this point in the history
…pe-variant

Use serialize_entry instead of serialize_key + serialize_value when serialize flatten newtype enum variant
  • Loading branch information
dtolnay committed Aug 5, 2024
2 parents 28a0922 + bc5af50 commit e08c5de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions serde/src/private/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit e08c5de

Please sign in to comment.