| ... | @@ -523,7 +523,7 @@ pub const Builder = struct { | ... | @@ -523,7 +523,7 @@ pub const Builder = struct { |
| 523 | const name = self.dupe(name_raw); | 523 | const name = self.dupe(name_raw); |
| 524 | const description = self.dupe(description_raw); | 524 | const description = self.dupe(description_raw); |
| 525 | const type_id = comptime typeToEnum(T); | 525 | const type_id = comptime typeToEnum(T); |
| 526 | const enum_options: ?ArrayList([]const u8) = if (type_id == .@"enum") blk: { | 526 | const enum_options = if (type_id == .@"enum") blk: { |
| 527 | const fields = comptime std.meta.fields(T); | 527 | const fields = comptime std.meta.fields(T); |
| 528 | var options = ArrayList([]const u8).initCapacity(self.allocator, fields.len) catch unreachable; | 528 | var options = ArrayList([]const u8).initCapacity(self.allocator, fields.len) catch unreachable; |
| 529 | | 529 | |
| ... | @@ -531,13 +531,13 @@ pub const Builder = struct { | ... | @@ -531,13 +531,13 @@ pub const Builder = struct { |
| 531 | options.appendAssumeCapacity(field.name); | 531 | options.appendAssumeCapacity(field.name); |
| 532 | } | 532 | } |
| 533 | | 533 | |
| 534 | break :blk options; | 534 | break :blk options.toOwnedSlice() catch unreachable; |
| 535 | } else null; | 535 | } else null; |
| 536 | const available_option = AvailableOption{ | 536 | const available_option = AvailableOption{ |
| 537 | .name = name, | 537 | .name = name, |
| 538 | .type_id = type_id, | 538 | .type_id = type_id, |
| 539 | .description = description, | 539 | .description = description, |
| 540 | .enum_options = if (enum_options) |options| options.items else null, | 540 | .enum_options = enum_options, |
| 541 | }; | 541 | }; |
| 542 | if ((self.available_options_map.fetchPut(name, available_option) catch unreachable) != null) { | 542 | if ((self.available_options_map.fetchPut(name, available_option) catch unreachable) != null) { |
| 543 | panic("Option '{s}' declared twice", .{name}); | 543 | panic("Option '{s}' declared twice", .{name}); |