GoSuB Browser Progress, pt11
2023-09-07 · 2 years ago
I ran into a bit of trouble with the document tree generation. This is where a good grasp of the borrow checker comes into play, and I'm not there yet :(
So, I was trying to make use of Rc<Node> to use references all over the place, but this was proven to be more difficult and less readable. Instead I've opted for an arena like system. I have a hashmap of nodes called the arena. This is the one and only owner of the nodes. Parent nodes and child nodes are set by node_id. So instead of pointing to a node, it has a node-id, which in turn can be fetched from the arena.
The codebase looks more readable not without all the refcells and rc:clones all over the place. So we will see how this will go in the next couple of days.
Nobody amused yet.