diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-08-28 10:49:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-28 10:49:31 -0700 |
| commit | 31fef6f1103ea64a899729adea13b0ab9b66cb46 (patch) | |
| tree | 31c13b06483af84cd0977be8de00d3539e3e3c4d /lib/std/multi_array_list.zig | |
| parent | 9a12905a2da045b0948f612583b526bca3a1b2f0 (diff) | |
| parent | aaa7e739831f39151a37c7beb08660f0fb6ae0ed (diff) | |
| download | zig-31fef6f1103ea64a899729adea13b0ab9b66cb46.tar.gz zig-31fef6f1103ea64a899729adea13b0ab9b66cb46.zip | |
Merge pull request #21225 from mlugg/std-builtin-type
std: update `std.builtin.Type` fields to follow naming conventions
Diffstat (limited to 'lib/std/multi_array_list.zig')
| -rw-r--r-- | lib/std/multi_array_list.zig | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/std/multi_array_list.zig b/lib/std/multi_array_list.zig index cfe77f11b5..0d9272d492 100644 --- a/lib/std/multi_array_list.zig +++ b/lib/std/multi_array_list.zig @@ -24,10 +24,9 @@ pub fn MultiArrayList(comptime T: type) type { capacity: usize = 0, const Elem = switch (@typeInfo(T)) { - .Struct => T, - .Union => |u| struct { - pub const Bare = - @Type(.{ .Union = .{ + .@"struct" => T, + .@"union" => |u| struct { + pub const Bare = @Type(.{ .@"union" = .{ .layout = u.layout, .tag_type = null, .fields = u.fields, @@ -84,8 +83,8 @@ pub fn MultiArrayList(comptime T: type) type { pub fn set(self: *Slice, index: usize, elem: T) void { const e = switch (@typeInfo(T)) { - .Struct => elem, - .Union => Elem.fromT(elem), + .@"struct" => elem, + .@"union" => Elem.fromT(elem), else => unreachable, }; inline for (fields, 0..) |field_info, i| { @@ -99,8 +98,8 @@ pub fn MultiArrayList(comptime T: type) type { @field(result, field_info.name) = self.items(@as(Field, @enumFromInt(i)))[index]; } return switch (@typeInfo(T)) { - .Struct => result, - .Union => Elem.toT(result.tags, result.data), + .@"struct" => result, + .@"union" => Elem.toT(result.tags, result.data), else => unreachable, }; } @@ -287,8 +286,8 @@ pub fn MultiArrayList(comptime T: type) type { assert(index <= self.len); self.len += 1; const entry = switch (@typeInfo(T)) { - .Struct => elem, - .Union => Elem.fromT(elem), + .@"struct" => elem, + .@"union" => Elem.fromT(elem), else => unreachable, }; const slices = self.slice(); @@ -557,7 +556,7 @@ pub fn MultiArrayList(comptime T: type) type { .is_comptime = fields[i].is_comptime, .alignment = fields[i].alignment, }; - break :entry @Type(.{ .Struct = .{ + break :entry @Type(.{ .@"struct" = .{ .layout = .@"extern", .fields = &entry_fields, .decls = &.{}, |
