Zig 0.14+ can directly compare packed structs.
parent
ac104a3dfc
commit
4614e5fdad
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue