Clean up section spacing around namespace entries
diff --git a/gen/src/write.rs b/gen/src/write.rs
index 194241a..9046d69 100644
--- a/gen/src/write.rs
+++ b/gen/src/write.rs
@@ -22,7 +22,6 @@
     out.include.extend(&opt.include);
 
     let apis_by_namespace = NamespaceEntries::new(apis);
-
     gen_namespace_forward_declarations(out, &apis_by_namespace);
     gen_namespace_contents(out, &apis_by_namespace, opt);
 
@@ -132,12 +131,11 @@
         }
     }
 
-    out.next_section();
-
     for (child_ns, child_ns_entries) in ns_entries.children() {
-        writeln!(out, "namespace {} {{", child_ns);
+        let block = format!("namespace {}", child_ns);
+        out.begin_block(&block);
         gen_namespace_contents(out, child_ns_entries, opt);
-        writeln!(out, "}} // namespace {}", child_ns);
+        out.end_block(&block);
     }
 }