Function pop [src]
Remove and return the last node in the list.
Returns:
A pointer to the last node in the list.
Prototype
pub fn pop(list: *DoublyLinkedList) ?*Node
Parameters
list: *DoublyLinkedList
Source
pub fn pop(list: *DoublyLinkedList) ?*Node {
const last = list.last orelse return null;
list.remove(last);
return last;
}