| ... | @@ -102,12 +102,7 @@ pub fn sliceToInt(comptime T: type, comptime E: type, slice: []const E) !T { | ... | @@ -102,12 +102,7 @@ pub fn sliceToInt(comptime T: type, comptime E: type, slice: []const E) !T { |
| 102 | } | 102 | } |
| 103 | | 103 | |
| 104 | pub fn FieldType(comptime T: type, comptime field: std.meta.FieldEnum(T)) type { | 104 | pub fn FieldType(comptime T: type, comptime field: std.meta.FieldEnum(T)) type { |
| 105 | inline for (std.meta.fields(T)) |item| { | 105 | return std.meta.fieldInfo(T, field).field_type; |
| 106 | if (comptime std.mem.eql(u8, item.name, @tagName(field))) { | | |
| 107 | return item.field_type; | | |
| 108 | } | | |
| 109 | } | | |
| 110 | unreachable; | | |
| 111 | } | 106 | } |
| 112 | | 107 | |
| 113 | pub fn fileList(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]string { | 108 | pub fn fileList(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]string { |