Touch up PR 121
diff --git a/gen/write.rs b/gen/write.rs
index a77c658..4c7b0ae 100644
--- a/gen/write.rs
+++ b/gen/write.rs
@@ -63,13 +63,12 @@
out.next_section();
write_struct(out, strct);
}
- Api::RustType(ety) => match methods_for_type.get(&ety.ident) {
- Some(methods) => {
+ Api::RustType(ety) => {
+ if let Some(methods) = methods_for_type.get(&ety.ident) {
out.next_section();
write_struct_with_methods(out, ety, methods);
}
- _ => {}
- },
+ }
_ => {}
}
}
@@ -323,7 +322,7 @@
writeln!(out, "using {} = {};", ident, ident);
}
-fn write_struct_with_methods(out: &mut OutFile, ety: &ExternType, methods: &Vec<&ExternFn>) {
+fn write_struct_with_methods(out: &mut OutFile, ety: &ExternType, methods: &[&ExternFn]) {
for line in ety.doc.to_string().lines() {
writeln!(out, "//{}", line);
}