commit 63a45b8ecdc9e4babd883be71dde1826f32b556f (tree)
parent a83db33ba2d5fddcc453735a7a0d9b57c67739a8
Author: Ryan Liptak <squeek502@hotmail.com>
Date: Sat, 25 Oct 2025 21:28:54 -0700
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/std/SinglyLinkedList.zig b/lib/std/SinglyLinkedList.zig
@@ -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;