diff --git a/build.zig.zon b/build.zig.zon index 77c232a..702d6bc 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -9,8 +9,8 @@ .dependencies = .{ .statspatch = .{ - .url = "git+https://git.mzte.de/LordMZTE/statspatch.git#9f6c8648e9901646b440b525201b77dbabc04bba", - .hash = "122093d8dbfbd8f5e28734da73d9e5be1d6b2d41cf234e07daf2dfd7abf7ba65d976", + .url = "git+https://git.mzte.de/lordmzte/statspatch.git#c9143e5e9cfcdad99a49748ce6df5ac5c31e51cd", + .hash = "1220d5aad80984589108230b8e16b8e823c16acbb123fce3c1e7c2e5be442b7366be", }, }, } diff --git a/src/backevent.zig b/src/backevent.zig index f78a3c0..d99ed44 100644 --- a/src/backevent.zig +++ b/src/backevent.zig @@ -22,7 +22,7 @@ fn Prototype(comptime Self: type) type { /// Called if the Backevent made it's way up the widget tree without being intercepted. /// The root widget will be passed. pub fn unhandled(self: Self, root: *Widget) !void { - try (statspatch.implcallOptional( + try @as(anyerror!void, statspatch.implcallOptional( self, .self, "unhandled", diff --git a/src/painter.zig b/src/painter.zig index 604aba8..422f72c 100644 --- a/src/painter.zig +++ b/src/painter.zig @@ -64,7 +64,7 @@ fn Prototype(comptime Self: type) type { "strokeRect", anyerror!void, .{ self, rectangle, line_width, stroke_color, fill_color }, - )) |ret| try ret else { + )) |ret| try @as(anyerror!void, ret) else { // TODO: draw as 2 rects if fill_color is set const ud_size = Size{ .width = rectangle.size.width, @@ -219,7 +219,7 @@ fn Prototype(comptime Self: type) type { "chunk", anyerror!void, .{ self, pos, text_chunk }, - )) |ret| try ret else { + )) |ret| try @as(anyerror!void, ret) else { for (text_chunk.spans.items) |ss| { try self.span(pos.add(ss.position), ss.span); } diff --git a/src/platform.zig b/src/platform.zig index 1c10cd7..a6215f8 100644 --- a/src/platform.zig +++ b/src/platform.zig @@ -15,7 +15,7 @@ fn Prototype(comptime Self: type) type { /// Called when a widget subtree is unlinked on this platform. /// Do not call this directly, instead call Widget.unlink. pub fn onSubtreeUnlink(self: *Self, widget: *Widget) !void { - try (statspatch.implcallOptional( + try @as(anyerror!void, statspatch.implcallOptional( self, .ptr, "onSubtreeUnlink", diff --git a/src/widget.zig b/src/widget.zig index 350dec3..9485601 100644 --- a/src/widget.zig +++ b/src/widget.zig @@ -48,7 +48,7 @@ fn Prototype(comptime Self: type) type { // Possibly call an initialize function. The widget can do any necessary // initialization of it's data here. - _ = try (statspatch.implcallOptional(self, .ptr, "initialize", anyerror!void, .{self}) orelse {}); + _ = try @as(anyerror!void, statspatch.implcallOptional(self, .ptr, "initialize", anyerror!void, .{self}) orelse {}); return self; } @@ -80,7 +80,7 @@ fn Prototype(comptime Self: type) type { } pub fn backevent(self: *Self, ev: Backevent) !void { - try (statspatch.implcallOptional( + try @as(anyerror!void, statspatch.implcallOptional( self, .ptr, "backevent", @@ -169,7 +169,13 @@ fn Prototype(comptime Self: type) type { /// It is safe to deinitialize the subtree after it has been unlinked. pub fn unlink(self: *Self) !void { zenolith.log.debug("child {s}@{x} unlinked", .{ @tagName(self.u), @intFromPtr(self) }); - try (statspatch.implcallOptional(self, .ptr, "unlink", anyerror!void, .{self}) orelse {}); + try @as(anyerror!void, statspatch.implcallOptional( + self, + .ptr, + "unlink", + anyerror!void, + .{self}, + ) orelse {}); self.data.parent = null; if (self.data.platform) |p| try p.onSubtreeUnlink(self);