Touch up PR 2795

This commit is contained in:
David Tolnay 2024-08-12 13:00:04 -07:00
parent f9866097a0
commit f61d452814
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 3 additions and 2 deletions

View File

@ -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()

View File

@ -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