#linked list;
1 messages · Page 1 of 1 (latest)
im very new to programming, i actually dont know how to unwrap it sorry ;-;
Chapter 1 - This will get you up to speed with almost all of the Zig programming language. This part of the tutorial should be coverable in under an hour.
thank you!
pub fn remove(self: *Self, item: T) !T {
var curr = self.head;
while (curr) |node| : (curr = node.next) {
var nextNode = node.next.?;
if (nextNode.item == item) {
const value = nextNode.item;
node.next = nextNode.next;
self.allocator.destroy(nextNode);
return value;
}
}
return ItemNotFoundErr.DoesNotExist;
}
i made it ;-;! thank you ❤️