| author | |
| committer | |
| log | e609abac9f01ff0f54ca928feb0bec165cd6eebf |
| tree | 52f1b35c8b792f63efe14c0547f3dd735adc585e |
| parent | 54abdc5bce0b243601ef4808bce1c29e1a46cdec |
1 files changed, 4 insertions(+), 0 deletions(-)
src/lib.zig+4| ... | @@ -676,3 +676,7 @@ pub fn ReverseFields(comptime T: type) type { | ... | @@ -676,3 +676,7 @@ pub fn ReverseFields(comptime T: type) type { |
| 676 | info.fields = &fields; | 676 | info.fields = &fields; |
| 677 | return @Type(.{ .Struct = info }); | 677 | return @Type(.{ .Struct = info }); |
| 678 | } | 678 | } |
| 679 | |||
| 680 | pub fn stringToEnum(comptime E: type, str: ?string) ?E { | ||
| 681 | return std.meta.stringToEnum(E, str orelse return null); | ||
| 682 | } |