@@ -14,7 +14,6 @@ use std::{
1414 rc:: Rc ,
1515} ;
1616use wasm_encoder:: { ComponentTypeRef , ComponentValType , PrimitiveValType , TypeBounds , ValType } ;
17- use wasmparser:: names:: KebabString ;
1817
1918mod encode;
2019
@@ -124,10 +123,10 @@ struct ComponentContext {
124123 num_imports : usize ,
125124
126125 // The set of names of imports we've generated thus far.
127- import_names : HashSet < KebabString > ,
126+ import_names : HashSet < String > ,
128127
129128 // The set of URLs of imports we've generated thus far.
130- import_urls : HashSet < KebabString > ,
129+ import_urls : HashSet < String > ,
131130
132131 // This component's function index space.
133132 funcs : Vec < ComponentOrCoreFuncType > ,
@@ -1095,15 +1094,15 @@ impl ComponentBuilder {
10951094 fn arbitrary_instance_type_def (
10961095 & mut self ,
10971096 u : & mut Unstructured ,
1098- exports : & mut HashSet < KebabString > ,
1099- export_urls : & mut HashSet < KebabString > ,
1097+ exports : & mut HashSet < String > ,
1098+ export_urls : & mut HashSet < String > ,
11001099 type_fuel : & mut u32 ,
11011100 ) -> Result < InstanceTypeDecl > {
11021101 let mut choices: Vec <
11031102 fn (
11041103 & mut ComponentBuilder ,
1105- & mut HashSet < KebabString > ,
1106- & mut HashSet < KebabString > ,
1104+ & mut HashSet < String > ,
1105+ & mut HashSet < String > ,
11071106 & mut Unstructured ,
11081107 & mut u32 ,
11091108 ) -> Result < InstanceTypeDecl > ,
@@ -1498,7 +1497,7 @@ impl ComponentBuilder {
14981497 }
14991498 }
15001499
1501- fn push_import ( & mut self , name : KebabString , url : Option < String > , ty : ComponentTypeRef ) {
1500+ fn push_import ( & mut self , name : String , url : Option < String > , ty : ComponentTypeRef ) {
15021501 let nth = match self . ensure_section (
15031502 |sec| matches ! ( sec, Section :: Import ( _) ) ,
15041503 || Section :: Import ( ImportSection { imports : vec ! [ ] } ) ,
@@ -2018,7 +2017,7 @@ enum ComponentTypeDef {
20182017 Alias ( Alias ) ,
20192018 Import ( Import ) ,
20202019 Export {
2021- name : KebabString ,
2020+ name : String ,
20222021 url : Option < String > ,
20232022 ty : ComponentTypeRef ,
20242023 } ,
@@ -2046,16 +2045,16 @@ enum InstanceTypeDecl {
20462045 Type ( Rc < Type > ) ,
20472046 Alias ( Alias ) ,
20482047 Export {
2049- name : KebabString ,
2048+ name : String ,
20502049 url : Option < String > ,
20512050 ty : ComponentTypeRef ,
20522051 } ,
20532052}
20542053
20552054#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
20562055struct FuncType {
2057- params : Vec < ( KebabString , ComponentValType ) > ,
2058- results : Vec < ( Option < KebabString > , ComponentValType ) > ,
2056+ params : Vec < ( String , ComponentValType ) > ,
2057+ results : Vec < ( Option < String > , ComponentValType ) > ,
20592058}
20602059
20612060impl FuncType {
@@ -2112,12 +2111,12 @@ enum DefinedType {
21122111
21132112#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
21142113struct RecordType {
2115- fields : Vec < ( KebabString , ComponentValType ) > ,
2114+ fields : Vec < ( String , ComponentValType ) > ,
21162115}
21172116
21182117#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
21192118struct VariantType {
2120- cases : Vec < ( KebabString , Option < ComponentValType > , Option < u32 > ) > ,
2119+ cases : Vec < ( String , Option < ComponentValType > , Option < u32 > ) > ,
21212120}
21222121
21232122#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
@@ -2132,12 +2131,12 @@ struct TupleType {
21322131
21332132#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
21342133struct FlagsType {
2135- fields : Vec < KebabString > ,
2134+ fields : Vec < String > ,
21362135}
21372136
21382137#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
21392138struct EnumType {
2140- variants : Vec < KebabString > ,
2139+ variants : Vec < String > ,
21412140}
21422141
21432142#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
@@ -2158,7 +2157,7 @@ struct ImportSection {
21582157
21592158#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
21602159struct Import {
2161- name : KebabString ,
2160+ name : String ,
21622161 url : Option < String > ,
21632162 ty : ComponentTypeRef ,
21642163}
0 commit comments