diff --git a/src/lib.zig b/src/lib.zig index 46cf4297af8f28ecbb976686b702723359a56c30..9a711f99b9ab265fc215b197287207432d2f4aa2 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -102,12 +102,7 @@ pub fn sliceToInt(comptime T: type, comptime E: type, slice: []const E) !T { } pub fn FieldType(comptime T: type, comptime field: std.meta.FieldEnum(T)) type { - inline for (std.meta.fields(T)) |item| { - if (comptime std.mem.eql(u8, item.name, @tagName(field))) { - return item.field_type; - } - } - unreachable; + return std.meta.fieldInfo(T, field).field_type; } pub fn fileList(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]string {