From 5d2e8ca4f8f588f6206f073cf6e12522cdab0812 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Tue, 27 Jun 2023 08:32:32 -0700 Subject: [PATCH] Update casts for latest Zig (#19) * `@enumToInt` => `@intFromEnum` The `@enumToInt` built-in was just renamed to `@intFromEnum`. ref: https://github.com/ziglang/zig/commit/a6c8ee5231230947c928bbe1c6a39eb6e1bb9c5b * `@bitCast` no longer needs the type parameter `@bitCast` and other casts no longer need the destination type as an argument. ref: https://github.com/ziglang/zig/pull/16163 --- src/cursor.zig | 2 +- src/style.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cursor.zig b/src/cursor.zig index 8fd0c73..fbbd2ef 100644 --- a/src/cursor.zig +++ b/src/cursor.zig @@ -14,7 +14,7 @@ pub const CursorMode = enum(u8) { }; pub fn setCursorMode(writer: anytype, mode: CursorMode) !void { - const modeNumber = @enumToInt(mode); + const modeNumber = @intFromEnum(mode); try writer.print(csi ++ "{d} q", .{modeNumber}); } diff --git a/src/style.zig b/src/style.zig index 679b48a..e1371b2 100644 --- a/src/style.zig +++ b/src/style.zig @@ -96,11 +96,11 @@ pub const FontStyle = packed struct { }; pub fn toU11(self: Self) u11 { - return @bitCast(u11, self); + return @bitCast(self); } pub fn fromU11(bits: u11) Self { - return @bitCast(Self, bits); + return @bitCast(bits); } /// Returns true iff this font style contains no attributes