SinglyLinkedList.remove docs: Assumes -> asserts

Removing a node that is not in the list invokes safety-checked illegal behavior, so "asserts" is the recommended language to use.
This commit is contained in:
Ryan Liptak 2025-10-25 21:28:54 -07:00
parent a83db33ba2
commit 63a45b8ecd

View File

@ -86,7 +86,7 @@ pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {
}
/// Remove `node` from the list.
/// Assumes `node` is in the list.
/// Asserts that `node` is in the list.
pub fn remove(list: *SinglyLinkedList, node: *Node) void {
if (list.first == node) {
list.first = node.next;