From 8f1df6d539c848b98896524ad983087afc06be0b Mon Sep 17 00:00:00 2001 From: vms Date: Wed, 26 Aug 2020 19:09:55 +0300 Subject: [PATCH] beatify --- src/encoders/wat.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/encoders/wat.rs b/src/encoders/wat.rs index b566663..7fed208 100644 --- a/src/encoders/wat.rs +++ b/src/encoders/wat.rs @@ -85,7 +85,7 @@ impl ToString for &InterfaceType { impl ToString for &RecordType { fn to_string(&self) -> String { format!( - "record {} {fields}", + "record {} {{\n{fields}\n}}", self.name, fields = self .fields @@ -97,6 +97,7 @@ impl ToString for &RecordType { field_type.name, (&field_type.ty).to_string() )); + accumulator.push(','); accumulator }), ) @@ -179,6 +180,7 @@ fn encode_function_arguments(arguments: &[FunctionArg]) -> String { accumulator.push_str(name); accumulator.push_str(": "); accumulator.push_str(&ty.to_string()); + accumulator.push(','); accumulator } )