diff --git a/scripts/_common.zig b/scripts/_common.zig index 7a61ab8d3e552eace9879e351a3fd0f70196e6c1..4e8821bc57073cd451f874f62e06c14713646bfc 100644 --- a/scripts/_common.zig +++ b/scripts/_common.zig @@ -67,3 +67,9 @@ pub fn Main(comptime T: type) type { } }; } + +pub fn stringToEnum(comptime T: type, str: []const u8) !void { + if (std.meta.stringToEnum(T, str)) |_| {} else { + std.log.warn("{s} is not part of the type {s}", .{ str, @typeName(T) }); + } +}