summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig
index 93356d6..93cd5d4 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -60,7 +60,7 @@ const CommandMap = blk: {
60 map_data[1] = .{ "--version", .version }; 60 map_data[1] = .{ "--version", .version };
61 var idx: usize = 2; 61 var idx: usize = 2;
62 inline for (commands) |command| { 62 inline for (commands) |command| {
63 map_data[idx] = .{ command.name, @intToEnum(Command, command.value) }; 63 map_data[idx] = .{ command.name, @as(Command, @enumFromInt(command.value)) };
64 idx += 1; 64 idx += 1;
65 } 65 }
66 66
@@ -78,7 +78,7 @@ fn dispatch(
78 const cmd_enum = CommandMap.get(cmd) orelse return @call(.auto, default_fn, args); 78 const cmd_enum = CommandMap.get(cmd) orelse return @call(.auto, default_fn, args);
79 const commands = @typeInfo(Command).Enum.fields; 79 const commands = @typeInfo(Command).Enum.fields;
80 inline for (commands) |command| { 80 inline for (commands) |command| {
81 if (@enumToInt(cmd_enum) == command.value) { 81 if (@intFromEnum(cmd_enum) == command.value) {
82 const fun = @field(@field(@This(), command.name), fn_name); 82 const fun = @field(@field(@This(), command.name), fn_name);
83 return @call(.auto, fun, args); 83 return @call(.auto, fun, args);
84 } 84 }