@@ -84,7 +84,7 @@ fn parse_estree_attr(location: AttrLocation, part: AttrPart) -> Result<()> {
8484 match location {
8585 // `#[estree]` attr on struct
8686 AttrLocation :: Struct ( struct_def) => match part {
87- AttrPart :: Tag ( "always_flatten " ) => struct_def. estree . always_flatten = true ,
87+ AttrPart :: Tag ( "flatten " ) => struct_def. estree . flatten = true ,
8888 AttrPart :: Tag ( "no_type" ) => struct_def. estree . no_type = true ,
8989 AttrPart :: Tag ( "custom_serialize" ) => struct_def. estree . custom_serialize = true ,
9090 AttrPart :: String ( "rename" , value) => struct_def. estree . rename = Some ( value) ,
@@ -266,15 +266,15 @@ pub fn should_add_type_field_to_struct(struct_def: &StructDef) -> bool {
266266/// Get if should flatten a struct field.
267267///
268268/// Returns `true` if either the field has an `#[estree(flatten)]` attr on it,
269- /// or the type that the field contains has an `#[estree(always_flatten )]` attr.
269+ /// or the type that the field contains has an `#[estree(flatten )]` attr.
270270///
271271/// This function also used by Typescript generator.
272272pub fn should_flatten_field ( field : & FieldDef , schema : & Schema ) -> bool {
273273 if field. estree . flatten {
274274 true
275275 } else {
276276 let field_type = field. type_def ( schema) ;
277- matches ! ( field_type, TypeDef :: Struct ( field_struct_def) if field_struct_def. estree. always_flatten )
277+ matches ! ( field_type, TypeDef :: Struct ( field_struct_def) if field_struct_def. estree. flatten )
278278 }
279279}
280280
0 commit comments