@@ -1453,20 +1453,6 @@ impl ComponentBuilder {
14531453 Ok ( EnumType { variants } )
14541454 }
14551455
1456- fn arbitrary_union_type ( & self , u : & mut Unstructured , type_fuel : & mut u32 ) -> Result < UnionType > {
1457- let mut variants = vec ! [ ] ;
1458- arbitrary_loop ( u, 1 , 100 , |u| {
1459- * type_fuel = type_fuel. saturating_sub ( 1 ) ;
1460- if * type_fuel == 0 {
1461- return Ok ( false ) ;
1462- }
1463-
1464- variants. push ( self . arbitrary_component_val_type ( u) ?) ;
1465- Ok ( true )
1466- } ) ?;
1467- Ok ( UnionType { variants } )
1468- }
1469-
14701456 fn arbitrary_option_type ( & self , u : & mut Unstructured ) -> Result < OptionType > {
14711457 Ok ( OptionType {
14721458 inner_ty : self . arbitrary_component_val_type ( u) ?,
@@ -1491,7 +1477,7 @@ impl ComponentBuilder {
14911477 u : & mut Unstructured ,
14921478 type_fuel : & mut u32 ,
14931479 ) -> Result < DefinedType > {
1494- match u. int_in_range ( 0 ..=9 ) ? {
1480+ match u. int_in_range ( 0 ..=8 ) ? {
14951481 0 => Ok ( DefinedType :: Primitive (
14961482 self . arbitrary_primitive_val_type ( u) ?,
14971483 ) ) ,
@@ -1505,9 +1491,8 @@ impl ComponentBuilder {
15051491 4 => Ok ( DefinedType :: Tuple ( self . arbitrary_tuple_type ( u, type_fuel) ?) ) ,
15061492 5 => Ok ( DefinedType :: Flags ( self . arbitrary_flags_type ( u, type_fuel) ?) ) ,
15071493 6 => Ok ( DefinedType :: Enum ( self . arbitrary_enum_type ( u, type_fuel) ?) ) ,
1508- 7 => Ok ( DefinedType :: Union ( self . arbitrary_union_type ( u, type_fuel) ?) ) ,
1509- 8 => Ok ( DefinedType :: Option ( self . arbitrary_option_type ( u) ?) ) ,
1510- 9 => Ok ( DefinedType :: Result ( self . arbitrary_result_type ( u) ?) ) ,
1494+ 7 => Ok ( DefinedType :: Option ( self . arbitrary_option_type ( u) ?) ) ,
1495+ 8 => Ok ( DefinedType :: Result ( self . arbitrary_result_type ( u) ?) ) ,
15111496 _ => unreachable ! ( ) ,
15121497 }
15131498 }
@@ -2120,7 +2105,6 @@ enum DefinedType {
21202105 Tuple ( TupleType ) ,
21212106 Flags ( FlagsType ) ,
21222107 Enum ( EnumType ) ,
2123- Union ( UnionType ) ,
21242108 Option ( OptionType ) ,
21252109 Result ( ResultType ) ,
21262110}
@@ -2155,11 +2139,6 @@ struct EnumType {
21552139 variants : Vec < KebabString > ,
21562140}
21572141
2158- #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
2159- struct UnionType {
2160- variants : Vec < ComponentValType > ,
2161- }
2162-
21632142#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
21642143struct OptionType {
21652144 inner_ty : ComponentValType ,
0 commit comments