about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/value-to-xml.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libexpr/value-to-xml.cc')
-rw-r--r--third_party/nix/src/libexpr/value-to-xml.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/third_party/nix/src/libexpr/value-to-xml.cc b/third_party/nix/src/libexpr/value-to-xml.cc
index 5ea1e09824c7..6247d25b9c34 100644
--- a/third_party/nix/src/libexpr/value-to-xml.cc
+++ b/third_party/nix/src/libexpr/value-to-xml.cc
@@ -137,15 +137,20 @@ static void printValueAsXML(EvalState& state, bool strict, bool location,
 
       if (v.lambda.fun->matchAttrs) {
         XMLAttrs attrs;
-        if (!v.lambda.fun->arg.empty()) attrs["name"] = v.lambda.fun->arg;
-        if (v.lambda.fun->formals->ellipsis) attrs["ellipsis"] = "1";
+        if (!v.lambda.fun->arg.empty()) {
+          attrs["name"] = v.lambda.fun->arg;
+        }
+        if (v.lambda.fun->formals->ellipsis) {
+          attrs["ellipsis"] = "1";
+        }
         XMLOpenElement _(doc, "attrspat", attrs);
-        for (auto& i : v.lambda.fun->formals->formals)
+        for (auto& i : v.lambda.fun->formals->formals) {
           doc.writeEmptyElement("attr", singletonAttrs("name", i.name));
+        }
       } else {
-        doc
+        doc.writeEmptyElement("varpat",
+                              singletonAttrs("name", v.lambda.fun->arg));
       }
-      .writeEmptyElement("varpat", singletonAttrs("name", v.lambda.fun->arg));
 
       break;
     }