3 ms·
Option<Rc<RefCell<Node<T>>>> works, but you have to manage your own teardown of the list. If you use Weak, releasing the strong reference to the head of the li
by Animats 1y ago
Option<Rc<RefCell<Node<T>>>>
works, but you have to manage your own teardown of the list. If you use Weak, releasing the strong reference to the head of the list tears down the whole list.
- afdbcreid 1y agoYou want to handle teardown yourself anyway, as otherwise long lists could overflow the stack on drop. I'm not convinced not using `Weak` is better, though.