Skip to content

Commit 5d2e8ca

Browse files
authored
Update casts for latest Zig (#19)
* `@enumToInt` => `@intFromEnum` The `@enumToInt` built-in was just renamed to `@intFromEnum`. ref: ziglang/zig@a6c8ee5 * `@bitCast` no longer needs the type parameter `@bitCast` and other casts no longer need the destination type as an argument. ref: ziglang/zig#16163
1 parent 1bc351a commit 5d2e8ca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cursor.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub const CursorMode = enum(u8) {
1414
};
1515

1616
pub fn setCursorMode(writer: anytype, mode: CursorMode) !void {
17-
const modeNumber = @enumToInt(mode);
17+
const modeNumber = @intFromEnum(mode);
1818
try writer.print(csi ++ "{d} q", .{modeNumber});
1919
}
2020

src/style.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ pub const FontStyle = packed struct {
9696
};
9797

9898
pub fn toU11(self: Self) u11 {
99-
return @bitCast(u11, self);
99+
return @bitCast(self);
100100
}
101101

102102
pub fn fromU11(bits: u11) Self {
103-
return @bitCast(Self, bits);
103+
return @bitCast(bits);
104104
}
105105

106106
/// Returns true iff this font style contains no attributes

0 commit comments

Comments
 (0)