From 8c148fc32e6d083145ae8cd79649f85cbcfbb074 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 22 Mar 2024 21:04:05 -0700 Subject: [PATCH] terminal: use std.meta.eql for equality checks --- src/terminal/style.zig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/terminal/style.zig b/src/terminal/style.zig index 3f1c0208a..4011b4298 100644 --- a/src/terminal/style.zig +++ b/src/terminal/style.zig @@ -47,17 +47,12 @@ pub const Style = struct { /// True if the style is the default style. pub fn default(self: Style) bool { - const def: []const u8 = comptime std.mem.asBytes(&Style{}); - return std.mem.eql(u8, std.mem.asBytes(&self), def); + return std.meta.eql(self, .{}); } /// True if the style is equal to another style. pub fn eql(self: Style, other: Style) bool { - return std.mem.eql( - u8, - std.mem.asBytes(&self), - std.mem.asBytes(&other), - ); + return std.meta.eql(self, other); } /// Returns the bg color for a cell with this style given the cell