fix(zig-0.15): more syntax changes

This commit is contained in:
CJ van den Berg 2025-08-24 16:10:24 +02:00
parent 1bb73d877f
commit 71344d961f
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -147,18 +147,18 @@ pub const List = struct {
pub fn init(allocator: Allocator) List {
return .{
.allocator = allocator,
.list = ArrayList(EventHandler).init(allocator),
.list = .empty,
};
}
pub fn deinit(self: *List) void {
for (self.list.items) |*i|
i.deinit();
self.list.deinit();
self.list.deinit(self.allocator);
}
pub fn add(self: *List, h: EventHandler) !void {
(try self.list.addOne()).* = h;
(try self.list.addOne(self.allocator)).* = h;
}
pub fn remove(self: *List, h: EventHandler) !void {