ref(examples): avoid unnecessary casts
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 43s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 43s
This commit is contained in:
@@ -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| {
|
||||
|
||||
@@ -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| {
|
||||
|
||||
@@ -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| {
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user