authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-24 23:37:15 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-24 23:37:15 -08:00
logaa4f77ea988ad23fee6af78afbb1daafbd7193a2
tree5069b14cb1a26f873d4736d5a623803f6b4b1ded
parent7fba8434132d87c55f764bfdaf43d444dadd9094

much more straightforward FieldType impl


1 files changed, 1 insertions(+), 6 deletions(-)

src/lib.zig+1-6
......@@ -102,12 +102,7 @@ pub fn sliceToInt(comptime T: type, comptime E: type, slice: []const E) !T {
102102}
103103
104104pub fn FieldType(comptime T: type, comptime field: std.meta.FieldEnum(T)) type {
105 inline for (std.meta.fields(T)) |item| {
106 if (comptime std.mem.eql(u8, item.name, @tagName(field))) {
107 return item.field_type;
108 }
109 }
110 unreachable;
105 return std.meta.fieldInfo(T, field).field_type;
111106}
112107
113108pub fn fileList(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]string {