authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-09-15 21:26:54 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-09-15 21:26:54 -07:00
loge609abac9f01ff0f54ca928feb0bec165cd6eebf
tree52f1b35c8b792f63efe14c0547f3dd735adc585e
parent54abdc5bce0b243601ef4808bce1c29e1a46cdec

add stringToEnum


1 files changed, 4 insertions(+), 0 deletions(-)

src/lib.zig+4
......@@ -676,3 +676,7 @@ pub fn ReverseFields(comptime T: type) type {
676676 info.fields = &fields;
677677 return @Type(.{ .Struct = info });
678678}
679
680pub fn stringToEnum(comptime E: type, str: ?string) ?E {
681 return std.meta.stringToEnum(E, str orelse return null);
682}