mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Use switch
and not if
to format Kind
This commit is contained in:
@ -56,12 +56,9 @@ pub const Kind = union(enum) {
|
|||||||
_ = layout;
|
_ = layout;
|
||||||
_ = opts;
|
_ = opts;
|
||||||
|
|
||||||
// Format as a number if its a palette color otherwise
|
switch (self) {
|
||||||
// format as a string.
|
.palette => |p| try writer.print("{d}", .{p}),
|
||||||
if (self == .palette) {
|
.special => |s| try writer.print("{s}", .{@tagName(s)}),
|
||||||
try writer.print("{d}", .{self.palette});
|
|
||||||
} else {
|
|
||||||
try writer.print("{s}", .{@tagName(self.special)});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user