authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-22 17:50:07 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-12-22 17:50:07 -08:00
logf7a5fb25c141c3fe2f699918d6658b359190251e
tree8239f89802b876a05247fa2456c88eedda139c00
parent1457622b913f44be1a5db48f5b8e62c8743a7ea2

remove common.stringToEnum


2 files changed, 0 insertions(+), 9 deletions(-)

scripts/ArabicShaping.zig-3
......@@ -147,9 +147,6 @@ pub usingnamespace common.Main(struct {
147147 const g = std.mem.trim(u8, it.next().?, " ");
148148 const g2 = try std.mem.replaceOwned(u8, alloc, g, " ", "_");
149149
150 try common.stringToEnum(@import("../src/lib.zig").arabic_shaping.Joining.Type, t);
151 try common.stringToEnum(@import("../src/lib.zig").arabic_shaping.Joining.Group, g2);
152
153150 try writer.print(" .{{ .codepoint = 0x{s}, .schematic_name = \"{s}\", .joining_type = .{s}, .joining_group = .{s} }},\n", .{ c, n, t, g2 });
154151 return true;
155152 }
scripts/_common.zig-6
......@@ -79,12 +79,6 @@ pub fn Main(comptime T: type) type {
7979 };
8080}
8181
82pub fn stringToEnum(comptime T: type, str: []const u8) void {
83 if (std.meta.stringToEnum(T, str)) |_| {} else {
84 std.log.warn("{s} is not part of the type {s}", .{ str, @typeName(T) });
85 }
86}
87
8882pub fn nullify(input: []const u8) ?[]const u8 {
8983 return if (input.len == 0) null else input;
9084}