aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-26 11:21:30 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-26 11:21:30 -0500
commit6291e8e4926c2e7dbd5cfa651f862c7dbd2e5bda (patch)
treec30178b457a4afcca39e355da12502f2c6216a7f /lib/std
parentc4a2734aa08a9e810680d7be2c976fe3ae67cc5b (diff)
parent62de32a18c1eecedc29055e4199fa364f9e9b7c6 (diff)
downloadzig-6291e8e4926c2e7dbd5cfa651f862c7dbd2e5bda.tar.gz
zig-6291e8e4926c2e7dbd5cfa651f862c7dbd2e5bda.zip
Merge branch 'Vexu-tagname'
closes #4559 closes #3991
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/fmt.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig
index b9c6dd0033..d093101646 100644
--- a/lib/std/fmt.zig
+++ b/lib/std/fmt.zig
@@ -414,10 +414,9 @@ pub fn formatType(
if (max_depth == 0) {
return output(context, "{ ... }");
}
- comptime var field_i = 0;
try output(context, "{");
- inline for (StructT.fields) |f| {
- if (field_i == 0) {
+ inline for (StructT.fields) |f, i| {
+ if (i == 0) {
try output(context, " .");
} else {
try output(context, ", .");
@@ -425,7 +424,6 @@ pub fn formatType(
try output(context, f.name);
try output(context, " = ");
try formatType(@field(value, f.name), fmt, options, context, Errors, output, max_depth - 1);
- field_i += 1;
}
try output(context, " }");
},