Skip to content

Commit 530228d

Browse files
Deprecate std.enums.nameCast.
1 parent 6c598e8 commit 530228d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/std/enums.zig

+1-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ test "directEnumArrayDefault slice" {
197197
try testing.expectEqualSlices(u8, "default", array[2]);
198198
}
199199

200-
/// Cast an enum literal, value, or string to the enum value of type E
201-
/// with the same name.
200+
/// Deprecated: Use @field(E, @tagName(tag)) or @field(E, string)
202201
pub fn nameCast(comptime E: type, comptime value: anytype) E {
203202
return comptime blk: {
204203
const V = @TypeOf(value);

0 commit comments

Comments
 (0)