GoSuB Browser Progress, pt11

Created at 2023-09-07 13:27:44 (7 months 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.

rust gosub

About jaytaph

Codemuser extraordinaire

avatar Loves building crazy and insane stuff. Happiest when left alone. All I wanted was a Pepsi, just a Pepsi.
Joined:March 24, 2023
RSS feed