Deprecate std.enums.nameCast.

This commit is contained in:
Андрей Краевский 2025-04-16 00:36:43 +03:00 committed by GitHub
parent 6c598e8341
commit 530228d953
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -197,8 +197,7 @@ test "directEnumArrayDefault slice" {
try testing.expectEqualSlices(u8, "default", array[2]);
}
/// Cast an enum literal, value, or string to the enum value of type E
/// with the same name.
/// Deprecated: Use @field(E, @tagName(tag)) or @field(E, string)
pub fn nameCast(comptime E: type, comptime value: anytype) E {
return comptime blk: {
const V = @TypeOf(value);