Skip to content

Commit

Permalink
Touch up PR 2795
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 12, 2024
1 parent f986609 commit f61d452
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion serde_derive/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,8 @@ fn effective_style(variant: &Variant) -> Style {
}
}

/// True if there are fields that is not skipped and has a `#[serde(flatten)]` attribute.
/// True if there is any field with a `#[serde(flatten)]` attribute, other than
/// fields which are skipped.
fn has_flatten(fields: &[Field]) -> bool {
fields
.iter()
Expand Down
2 changes: 1 addition & 1 deletion serde_derive/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ fn serialize_struct(params: &Parameters, fields: &[Field], cattrs: &attr::Contai
"too many fields in {}: {}, maximum supported count is {}",
cattrs.name().serialize_name(),
fields.len(),
u32::MAX
u32::MAX,
);

let has_non_skipped_flatten = fields
Expand Down

0 comments on commit f61d452

Please sign in to comment.