From 7e20dd73d91ad918f8932ecf8e34ac4f83a7114e Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Thu, 27 Mar 2025 21:41:18 +0100 Subject: [PATCH] mod: add missing `inline` function attribute Correct example to use the actual `zterm.Error` type accordingly. --- examples/errors.zig | 2 +- src/element.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/errors.zig b/examples/errors.zig index fe73cce..acc8737 100644 --- a/examples/errors.zig +++ b/examples/errors.zig @@ -67,7 +67,7 @@ const ErrorNotification = struct { fn handle(ctx: *anyopaque, event: App.Event) !void { const this: *@This() = @ptrCast(@alignCast(ctx)); switch (event) { - .key => |key| if (!key.isAscii()) return error.UnsupportedKey, + .key => |key| if (!key.isAscii()) return zterm.Error.TooSmall, .err => |err| this.msg = err.msg, else => {}, } diff --git a/src/element.zig b/src/element.zig index dc297a0..e45f133 100644 --- a/src/element.zig +++ b/src/element.zig @@ -20,13 +20,13 @@ pub fn Element(Event: type) type { }; /// Resize the corresponding `Element` with the given *size*. - pub fn resize(this: @This(), size: Point) void { + pub inline fn resize(this: @This(), size: Point) void { if (this.vtable.resize) |resize_fn| resize_fn(this.ptr, size); } /// Reposition the corresponding `Element` with the given *origin*. - pub fn reposition(this: @This(), origin: Point) void { + pub inline fn reposition(this: @This(), origin: Point) void { if (this.vtable.reposition) |reposition_fn| reposition_fn(this.ptr, origin); }