1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Singly Linked list Node and Traversal (Generic, Production-Grade)
//!
//! Provides a generic singly linked list node and a traversal function.
//!
//! # Type Parameters
//! * `T`: Value type. Must implement `Clone`.
//!
//! # Example
//! ```rust
//! use lunaris_engine::linked_list::singly_linked_list::*;
//! let mut head = Some(Box::new(ListNode::new(1)));
//! head.as_mut().unwrap().next = Some(Box::new(ListNode::new(2)));
//! let vals = traverse(&head);
//! assert_eq!(vals, vec![1, 2]);
//! ```