Zig 0.14+ can directly compare packed structs.

This commit is contained in:
Jesse Miller
2025-09-02 14:58:21 -06:00
parent ac104a3dfc
commit 4614e5fdad

View File

@@ -85,7 +85,7 @@ pub const Style = struct {
/// True if the style is equal to another style.
pub fn eql(self: Style, other: Style) bool {
return @as(u16, @bitCast(self.flags)) == @as(u16, @bitCast(other.flags)) and
return self.flags == other.flags and
std.meta.eql(self.fg_color, other.fg_color) and
std.meta.eql(self.bg_color, other.bg_color) and
std.meta.eql(self.underline_color, other.underline_color);