mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
gtk: use unreachable
in switch statements
This commit is contained in:

committed by
Mitchell Hashimoto

parent
8afcce666a
commit
a50fc7bc50
@ -255,6 +255,7 @@ pub fn closeSurface(self: *Window, surface: *Surface) void {
|
|||||||
const alloc = surface.app.core_app.alloc;
|
const alloc = surface.app.core_app.alloc;
|
||||||
|
|
||||||
switch (surface.parent) {
|
switch (surface.parent) {
|
||||||
|
.none => unreachable,
|
||||||
.tab => |tab| self.closeTab(tab),
|
.tab => |tab| self.closeTab(tab),
|
||||||
.paned => |paned_tuple| {
|
.paned => |paned_tuple| {
|
||||||
const paned = paned_tuple[0];
|
const paned = paned_tuple[0];
|
||||||
@ -294,6 +295,7 @@ pub fn closeSurface(self: *Window, surface: *Surface) void {
|
|||||||
defer alloc.destroy(paned);
|
defer alloc.destroy(paned);
|
||||||
|
|
||||||
switch (paned.parent) {
|
switch (paned.parent) {
|
||||||
|
.none => unreachable,
|
||||||
.tab => |tab| {
|
.tab => |tab| {
|
||||||
// If parent of Paned we belong to is a tab, we can
|
// If parent of Paned we belong to is a tab, we can
|
||||||
// replace the child with the other surface
|
// replace the child with the other surface
|
||||||
@ -303,14 +305,8 @@ pub fn closeSurface(self: *Window, surface: *Surface) void {
|
|||||||
.paned => |paned_paned| {
|
.paned => |paned_paned| {
|
||||||
log.info("paned is nested, parent is paned. position={}", .{paned_paned[1]});
|
log.info("paned is nested, parent is paned. position={}", .{paned_paned[1]});
|
||||||
},
|
},
|
||||||
.none => {
|
|
||||||
log.info("paned has no parent", .{});
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
.none => {
|
|
||||||
log.info("no parent, dude?!", .{});
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user