mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-28 03:26:28 +00:00
style: use decl literals
This commit changes a LOT of areas of the code to use decl literals instead of redundantly referring to the type. These changes were mostly driven by some regex searches and then manual adjustment on a case-by-case basis. I almost certainly missed quite a few places where decl literals could be used, but this is a good first step in converting things, and other instances can be addressed when they're discovered. I tested GLFW+Metal and building the framework on macOS and tested a GTK build on Linux, so I'm 99% sure I didn't introduce any syntax errors or other problems with this. (fingers crossed)
This commit is contained in:
@@ -228,7 +228,7 @@ pub fn order(self: Selection, s: *const Screen) Order {
|
||||
/// Note that only forward and reverse are useful desired orders for this
|
||||
/// function. All other orders act as if forward order was desired.
|
||||
pub fn ordered(self: Selection, s: *const Screen, desired: Order) Selection {
|
||||
if (self.order(s) == desired) return Selection.init(
|
||||
if (self.order(s) == desired) return .init(
|
||||
self.start(),
|
||||
self.end(),
|
||||
self.rectangle,
|
||||
@@ -237,9 +237,9 @@ pub fn ordered(self: Selection, s: *const Screen, desired: Order) Selection {
|
||||
const tl = self.topLeft(s);
|
||||
const br = self.bottomRight(s);
|
||||
return switch (desired) {
|
||||
.forward => Selection.init(tl, br, self.rectangle),
|
||||
.reverse => Selection.init(br, tl, self.rectangle),
|
||||
else => Selection.init(tl, br, self.rectangle),
|
||||
.forward => .init(tl, br, self.rectangle),
|
||||
.reverse => .init(br, tl, self.rectangle),
|
||||
else => .init(tl, br, self.rectangle),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user