| ... | ... | @@ -55,7 +55,7 @@ pub fn values(comptime E: type) []const E { |
| 55 | 55 | /// A safe alternative to @tagName() for non-exhaustive enums that doesn't |
| 56 | 56 | /// panic when `e` has no tagged value. |
| 57 | 57 | /// Returns the tag name for `e` or null if no tag exists. |
| 58 | | pub fn tagName(comptime E: type, e: E) ?[]const u8 { |
| 58 | pub fn tagName(comptime E: type, e: E) ?[:0]const u8 { |
| 59 | 59 | return inline for (@typeInfo(E).@"enum".fields) |f| { |
| 60 | 60 | if (@intFromEnum(e) == f.value) break f.name; |
| 61 | 61 | } else null; |