Remove use of deprecated aliases/types + use upstream zigini

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2025-03-16 22:45:46 +01:00
parent 13ba52319c
commit 9ded9fd765
6 changed files with 17 additions and 17 deletions

View File

@@ -5,7 +5,7 @@ const TerminalBuffer = @import("../TerminalBuffer.zig");
pub fn CyclableLabel(comptime ItemType: type) type {
return struct {
const Allocator = std.mem.Allocator;
const ItemList = std.ArrayList(ItemType);
const ItemList = std.ArrayListUnmanaged(ItemType);
const DrawItemFn = *const fn (*Self, ItemType, usize, usize) bool;
const termbox = interop.termbox;
@@ -27,7 +27,7 @@ pub fn CyclableLabel(comptime ItemType: type) type {
return .{
.allocator = allocator,
.buffer = buffer,
.list = ItemList.init(allocator),
.list = .empty,
.current = 0,
.visible_length = 0,
.x = 0,
@@ -38,8 +38,8 @@ pub fn CyclableLabel(comptime ItemType: type) type {
};
}
pub fn deinit(self: Self) void {
self.list.deinit();
pub fn deinit(self: *Self) void {
self.list.deinit(self.allocator);
}
pub fn position(self: *Self, x: usize, y: usize, visible_length: usize, text_in_center: ?bool) void {
@@ -53,7 +53,7 @@ pub fn CyclableLabel(comptime ItemType: type) type {
}
pub fn addItem(self: *Self, item: ItemType) !void {
try self.list.append(item);
try self.list.append(self.allocator, item);
self.current = self.list.items.len - 1;
}