3 ms·
> It was a real trial-by-fire thanks to how tree structures have to be handled with the borrow checker. Eh, without parent-pointers you can just use a Box<T> i
by fasquoika 8y ago
> It was a real trial-by-fire thanks to how tree structures have to be handled with the borrow checker.
Eh, without parent-pointers you can just use a Box<T> in the obvious way. For more elaborate graphs you'd use arena allocation. Maybe not something a beginner would realize, but it's not that hard
- foldr 8y agoIt gets a lot hairier if you want to mutate anything, though.
- kurtisc 8y ago>without parent-pointers Well I had them. As soon as I realised it wasn't trivial I wanted to know how to do it and why it couldn't be trivial. >Maybe not something a beginner would realize, but it's not that hard It's OK to be bad at new things.