ref(examples): avoid unnecessary casts
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 43s

This commit is contained in:
2025-02-21 15:15:15 +01:00
parent 8cc047c1fa
commit 44e92735cf
8 changed files with 19 additions and 47 deletions

View File

@@ -11,7 +11,6 @@ const QuitText = struct {
pub fn element(this: *@This()) App.Element {
return .{
.ptr = this,
// no handle function required
.vtable = &.{ .content = content },
};
}
@@ -20,8 +19,8 @@ const QuitText = struct {
_ = ctx;
std.debug.assert(cells.len == @as(usize, size.cols) * @as(usize, size.rows));
const row: u16 = 2;
const col: u16 = size.cols / 2 -| (@as(u16, @truncate(text.len)) / 2);
const row = 2;
const col = size.cols / 2 -| (text.len / 2);
const anchor = (row * size.cols) + col;
for (text, 0..) |cp, idx| {