diff options
Diffstat (limited to 'src/walk.zig')
| -rw-r--r-- | src/walk.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/walk.zig b/src/walk.zig index 8747937d..0f181cfa 100644 --- a/src/walk.zig +++ b/src/walk.zig @@ -367,7 +367,7 @@ pub fn shape(comptime types: []const type) []const u8 { comptime { @setEvalBranchQuota(10_000_000); var out: []const u8 = ""; - for (types) |T| out = out ++ shapeOf(T, 0) ++ "\n"; + for (types) |T| out = out ++ (shapeOf(T, 0) ++ "\n"); return out; } } @@ -382,7 +382,7 @@ fn shapeOf(comptime T: type, comptime depth: u8) []const u8 { .float => |f| "f" ++ decimal(f.bits), .@"enum" => |e| blk: { var out: []const u8 = shapeOf(e.tag_type, depth + 1) ++ "{"; - for (e.field_names, e.field_values) |n, v| out = out ++ n ++ "=" ++ decimal(v) ++ ","; + for (e.field_names, e.field_values) |n, v| out = out ++ (n ++ "=" ++ decimal(v) ++ ","); break :blk out ++ "}"; }, .optional => |o| if (machinery(o.child)) "0" else "?" ++ shapeOf(o.child, depth + 1), @@ -397,13 +397,13 @@ fn shapeOf(comptime T: type, comptime depth: u8) []const u8 { var out: []const u8 = if (s.layout == .@"packed") "p{" else "{"; for (s.field_names, s.field_types, s.field_attrs) |name, F, attr| { if (attr.@"comptime" or excluded(T, name)) continue; - out = out ++ name ++ ":" ++ shapeOf(F, depth + 1) ++ ","; + out = out ++ (name ++ ":" ++ shapeOf(F, depth + 1) ++ ","); } break :blk out ++ "}"; }, .@"union" => |u| blk: { var out: []const u8 = shapeOf(u.tag_type.?, depth + 1) ++ "("; - for (u.field_names, u.field_types) |name, F| out = out ++ name ++ ":" ++ shapeOf(F, depth + 1) ++ ","; + for (u.field_names, u.field_types) |name, F| out = out ++ (name ++ ":" ++ shapeOf(F, depth + 1) ++ ","); break :blk out ++ ")"; }, .error_set => "error", |
