@@ -4,9 +4,7 @@ use std::fmt;
4
4
use std:: ops:: Range ;
5
5
use wasmparser:: { KnownCustom , Parser , Payload :: * } ;
6
6
7
- use crate :: {
8
- Author , ComponentNames , Description , Licenses , ModuleNames , Producers , RegistryMetadata , Source ,
9
- } ;
7
+ use crate :: { Author , ComponentNames , Description , Licenses , ModuleNames , Producers , Source } ;
10
8
11
9
/// A tree of the metadata found in a WebAssembly binary.
12
10
#[ derive( Debug , Serialize ) ]
@@ -18,8 +16,6 @@ pub enum Metadata {
18
16
name : Option < String > ,
19
17
/// The component's producers section, if any.
20
18
producers : Option < Producers > ,
21
- /// The component's registry metadata section, if any.
22
- registry_metadata : Option < RegistryMetadata > ,
23
19
/// The component's author section, if any.
24
20
author : Option < Author > ,
25
21
/// Human-readable description of the binary
@@ -39,8 +35,6 @@ pub enum Metadata {
39
35
name : Option < String > ,
40
36
/// The module's producers section, if any.
41
37
producers : Option < Producers > ,
42
- /// The module's registry metadata section, if any.
43
- registry_metadata : Option < RegistryMetadata > ,
44
38
/// The component's author section, if any.
45
39
author : Option < Author > ,
46
40
/// Human-readable description of the binary
@@ -116,14 +110,6 @@ impl Metadata {
116
110
. expect ( "non-empty metadata stack" )
117
111
. set_producers ( producers) ;
118
112
}
119
- KnownCustom :: Unknown if c. name ( ) == "registry-metadata" => {
120
- let registry: RegistryMetadata =
121
- RegistryMetadata :: from_bytes ( & c. data ( ) , 0 ) ?;
122
- metadata
123
- . last_mut ( )
124
- . expect ( "non-empty metadata stack" )
125
- . set_registry_metadata ( registry) ;
126
- }
127
113
KnownCustom :: Unknown if c. name ( ) == "author" => {
128
114
let a = Author :: parse_custom_section ( & c) ?;
129
115
match metadata. last_mut ( ) . expect ( "non-empty metadata stack" ) {
@@ -170,7 +156,6 @@ impl Metadata {
170
156
description : None ,
171
157
licenses : None ,
172
158
source : None ,
173
- registry_metadata : None ,
174
159
children : Vec :: new ( ) ,
175
160
range,
176
161
}
@@ -184,7 +169,6 @@ impl Metadata {
184
169
description : None ,
185
170
licenses : None ,
186
171
source : None ,
187
- registry_metadata : None ,
188
172
range,
189
173
}
190
174
}
@@ -200,16 +184,6 @@ impl Metadata {
200
184
Metadata :: Component { producers, .. } => * producers = Some ( p) ,
201
185
}
202
186
}
203
- fn set_registry_metadata ( & mut self , r : RegistryMetadata ) {
204
- match self {
205
- Metadata :: Module {
206
- registry_metadata, ..
207
- } => * registry_metadata = Some ( r) ,
208
- Metadata :: Component {
209
- registry_metadata, ..
210
- } => * registry_metadata = Some ( r) ,
211
- }
212
- }
213
187
fn push_child ( & mut self , child : Self ) {
214
188
match self {
215
189
Metadata :: Module { .. } => panic ! ( "module shouldnt have children" ) ,
@@ -221,10 +195,7 @@ impl Metadata {
221
195
let spaces = std:: iter:: repeat ( " " ) . take ( indent) . collect :: < String > ( ) ;
222
196
match self {
223
197
Metadata :: Module {
224
- name,
225
- producers,
226
- registry_metadata,
227
- ..
198
+ name, producers, ..
228
199
} => {
229
200
if let Some ( name) = name {
230
201
writeln ! ( f, "{spaces}module {name}:" ) ?;
@@ -234,15 +205,11 @@ impl Metadata {
234
205
if let Some ( producers) = producers {
235
206
producers. display ( f, indent + 4 ) ?;
236
207
}
237
- if let Some ( registry_metadata) = registry_metadata {
238
- registry_metadata. display ( f, indent + 4 ) ?;
239
- }
240
208
Ok ( ( ) )
241
209
}
242
210
Metadata :: Component {
243
211
name,
244
212
producers,
245
- registry_metadata,
246
213
children,
247
214
..
248
215
} => {
@@ -254,9 +221,6 @@ impl Metadata {
254
221
if let Some ( producers) = producers {
255
222
producers. display ( f, indent + 4 ) ?;
256
223
}
257
- if let Some ( registry_metadata) = registry_metadata {
258
- registry_metadata. display ( f, indent + 4 ) ?;
259
- }
260
224
for c in children {
261
225
c. display ( f, indent + 4 ) ?;
262
226
}
0 commit comments