mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 17:26:09 +03:00
terminal: use std.meta.eql for equality checks
This commit is contained in:
@ -47,17 +47,12 @@ pub const Style = struct {
|
|||||||
|
|
||||||
/// True if the style is the default style.
|
/// True if the style is the default style.
|
||||||
pub fn default(self: Style) bool {
|
pub fn default(self: Style) bool {
|
||||||
const def: []const u8 = comptime std.mem.asBytes(&Style{});
|
return std.meta.eql(self, .{});
|
||||||
return std.mem.eql(u8, std.mem.asBytes(&self), def);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// True if the style is equal to another style.
|
/// True if the style is equal to another style.
|
||||||
pub fn eql(self: Style, other: Style) bool {
|
pub fn eql(self: Style, other: Style) bool {
|
||||||
return std.mem.eql(
|
return std.meta.eql(self, other);
|
||||||
u8,
|
|
||||||
std.mem.asBytes(&self),
|
|
||||||
std.mem.asBytes(&other),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the bg color for a cell with this style given the cell
|
/// Returns the bg color for a cell with this style given the cell
|
||||||
|
Reference in New Issue
Block a user