From b78343a5511f068944e02ec427f41d7444ac28e9 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 22 Feb 2018 12:11:47 +0100 Subject: [PATCH] Fix enum formatting issues --- crates/wasm-bindgen-macro/src/ast.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/wasm-bindgen-macro/src/ast.rs b/crates/wasm-bindgen-macro/src/ast.rs index 9862f5ad..bde31d8d 100644 --- a/crates/wasm-bindgen-macro/src/ast.rs +++ b/crates/wasm-bindgen-macro/src/ast.rs @@ -333,12 +333,11 @@ impl Program { .filter_map(|e| e.class) .chain(self.structs.iter().map(|s| s.name)) .collect::>(); - a.list(&names, |s, a| { let val = shared::name_to_descriptor(s.as_ref()); a.fields(&[ ("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(&[ ("name", &|a| a.str(self.name.as_ref())), ("variants", &|a| a.list(&self.variants, |v, a| { - a.fields(&[ - ("name", &|a| a.str(v.as_ref())) - ]) + a.fields(&[("name", &|a| a.str(v.as_ref()))]) })), ]); }