Skip to content

Commit

Permalink
Clarify format_field parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
escritorio-gustavo committed Jan 25, 2024
1 parent 7eefc38 commit f4d4d00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions macros/src/types/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TokenStream>,
flattened_fields: &mut Vec<TokenStream>,
Expand Down

0 comments on commit f4d4d00

Please sign in to comment.