@@ -15,7 +15,7 @@ pub struct CombineTypesVisitor {
1515 pub r#override : bool ,
1616 pub get_enum_variant :
1717 fn ( korok : & EnumVariantKorok , parent : & str ) -> Option < CodamaResult < EnumVariantTypeNode > > ,
18- pub get_nammed_field :
18+ pub get_named_field :
1919 fn ( korok : & FieldKorok , parent : & str ) -> Option < CodamaResult < StructFieldTypeNode > > ,
2020 pub get_unnammed_field :
2121 fn ( korok : & FieldKorok , parent : & str , index : usize ) -> Option < CodamaResult < TypeNode > > ,
@@ -27,7 +27,7 @@ impl Default for CombineTypesVisitor {
2727 Self {
2828 r#override : false ,
2929 get_enum_variant : |x, _| Self :: get_default_enum_variant ( x) ,
30- get_nammed_field : |x, _| Self :: get_default_named_field ( x) ,
30+ get_named_field : |x, _| Self :: get_default_named_field ( x) ,
3131 get_unnammed_field : |x, _, _| Self :: get_default_unnamed_field ( x) ,
3232 parent_enum : String :: new ( ) ,
3333 }
@@ -41,7 +41,7 @@ impl CombineTypesVisitor {
4141 pub fn strict ( ) -> Self {
4242 Self {
4343 get_enum_variant : Self :: get_strict_enum_variant,
44- get_nammed_field : Self :: get_strict_named_field,
44+ get_named_field : Self :: get_strict_named_field,
4545 get_unnammed_field : Self :: get_strict_unnamed_field,
4646 ..Self :: default ( )
4747 }
@@ -124,7 +124,7 @@ impl CombineTypesVisitor {
124124 ) -> CodamaResult < Vec < StructFieldTypeNode > > {
125125 let fields = fields
126126 . iter ( )
127- . filter_map ( |field| ( self . get_nammed_field ) ( field, parent) )
127+ . filter_map ( |field| ( self . get_named_field ) ( field, parent) )
128128 . collect_and_combine_errors ( ) ?;
129129
130130 let ( before, after) : ( Vec < _ > , Vec < _ > ) = attributes
@@ -173,9 +173,9 @@ impl KorokVisitor for CombineTypesVisitor {
173173 StructTypeNode :: new ( fields) . into ( )
174174 }
175175 syn:: Fields :: Unnamed ( _) => {
176- let items = self . parse_unnamed_fields ( & korok. fields , & parent) ?;
176+ let mut items = self . parse_unnamed_fields ( & korok. fields , & parent) ?;
177177 if items. len ( ) == 1 {
178- items. first ( ) . unwrap ( ) . clone ( )
178+ items. remove ( 0 )
179179 } else {
180180 TupleTypeNode :: new ( items) . into ( )
181181 }
0 commit comments