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