diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-09-27 14:32:45 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-09-27 14:32:49 -0700 |
| commit | 397e47c274fb5077e16b37f28c8f9327cc995b2e (patch) | |
| tree | 0bbf858d2c5e01d794e88d6ee310eb743de1d7ed /src/lib | |
| parent | a79e68ace105815f45a52ee0b4ff03bf5558fa0b (diff) | |
terminal: use LibEnum for the command keys
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/enum.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/enum.zig b/src/lib/enum.zig index 01006f46f..063232176 100644 --- a/src/lib/enum.zig +++ b/src/lib/enum.zig @@ -35,7 +35,8 @@ pub fn Enum( fields_i += 1; } - return @Type(.{ .@"enum" = .{ + // Assigned to var so that the type name is nicer in stack traces. + const Result = @Type(.{ .@"enum" = .{ .tag_type = switch (target) { .c => c_int, .zig => std.math.IntFittingRange(0, fields_i - 1), @@ -44,6 +45,7 @@ pub fn Enum( .decls = &.{}, .is_exhaustive = true, } }); + return Result; } pub const Target = union(enum) { |
