fix(zig-0.15): more syntax changes
This commit is contained in:
parent
1bb73d877f
commit
71344d961f
1 changed files with 3 additions and 3 deletions
|
@ -147,18 +147,18 @@ pub const List = struct {
|
||||||
pub fn init(allocator: Allocator) List {
|
pub fn init(allocator: Allocator) List {
|
||||||
return .{
|
return .{
|
||||||
.allocator = allocator,
|
.allocator = allocator,
|
||||||
.list = ArrayList(EventHandler).init(allocator),
|
.list = .empty,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deinit(self: *List) void {
|
pub fn deinit(self: *List) void {
|
||||||
for (self.list.items) |*i|
|
for (self.list.items) |*i|
|
||||||
i.deinit();
|
i.deinit();
|
||||||
self.list.deinit();
|
self.list.deinit(self.allocator);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add(self: *List, h: EventHandler) !void {
|
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 {
|
pub fn remove(self: *List, h: EventHandler) !void {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue