From f4d4d0065679bfe9674e8fddfe52e7195515b14f Mon Sep 17 00:00:00 2001 From: Gustavo Date: Thu, 25 Jan 2024 14:09:43 -0300 Subject: [PATCH] Clarify format_field parameters --- macros/src/types/named.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/macros/src/types/named.rs b/macros/src/types/named.rs index 987bb3768..3ec97d014 100644 --- a/macros/src/types/named.rs +++ b/macros/src/types/named.rs @@ -61,6 +61,15 @@ pub(crate) fn named( } // build an expresion which expands to a string, representing a single field of a struct. +// +// formatted_fields will contain all the fields that do not contain the flatten +// attribute, in the format +// key: type, +// +// flattened_fields will contain all the fields that contain the flatten attribute +// in their respective formats, which for a named struct is the same as formatted_fields, +// but for enums is +// ({ /* variant data */ } | { /* variant data */ }) fn format_field( formatted_fields: &mut Vec, flattened_fields: &mut Vec,