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

@@ -34,8 +34,8 @@ pub const Clickable = struct {
_ = ctx;
std.debug.assert(cells.len == @as(usize, size.cols) * @as(usize, size.rows));
const row: u16 = size.rows / 2 -| @as(u16, @truncate(text.len / 2));
const col: u16 = size.cols / 2 -| @as(u16, @truncate(text.len / 2));
const row = size.rows / 2 -| (text.len / 2);
const col = size.cols / 2 -| (text.len / 2);
const anchor = (row * size.cols) + col;
for (text, 0..) |cp, idx| {