1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-04-02 18:31:05 +00:00

Fix enum formatting issues

This commit is contained in:
Ryan Levick 2018-02-22 12:11:47 +01:00
parent 7f8316f89b
commit b78343a551

@ -333,12 +333,11 @@ impl Program {
.filter_map(|e| e.class) .filter_map(|e| e.class)
.chain(self.structs.iter().map(|s| s.name)) .chain(self.structs.iter().map(|s| s.name))
.collect::<BTreeSet<_>>(); .collect::<BTreeSet<_>>();
a.list(&names, |s, a| { a.list(&names, |s, a| {
let val = shared::name_to_descriptor(s.as_ref()); let val = shared::name_to_descriptor(s.as_ref());
a.fields(&[ a.fields(&[
("descriptor", &|a| a.char(val)), ("descriptor", &|a| a.char(val)),
("name", &|a| a.str(&s.as_ref())) ("name", &|a| a.str(s.as_ref()))
]); ]);
}) })
}), }),
@ -671,9 +670,7 @@ impl Enum {
a.fields(&[ a.fields(&[
("name", &|a| a.str(self.name.as_ref())), ("name", &|a| a.str(self.name.as_ref())),
("variants", &|a| a.list(&self.variants, |v, a| { ("variants", &|a| a.list(&self.variants, |v, a| {
a.fields(&[ a.fields(&[("name", &|a| a.str(v.as_ref()))])
("name", &|a| a.str(v.as_ref()))
])
})), })),
]); ]);
} }