3 ms·
Yep, but this replicates the original inelegancy (from the article): Option<Node> and Option<Box<Node>> are not the same type, and so they can't be treated the
by brundolf 6y ago
Yep, but this replicates the original inelegancy (from the article): Option<Node> and Option<Box<Node>> are not the same type, and so they can't be treated the same way.
- vips7L 6y agoI guess you could just allocate the head node on the heap too. I think rust probably has better tools for this. Probably some sort of let node = node.next; while let Some(n) = node { node = n.next }