GoSuB Browser Progress, pt11
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.
About jaytaph
Codemuser extraordinaire
Joined: | March 24, 2023 |
Following: | 2 |
Followers: | 2 |
Posts: | 50 |
Comments: | 3 |
Upvotes: | 4 |
Previous musings
- (1) November 2024
- (1) October 2024
- (1) September 2024
- (1) July 2024
- (2) February 2024
- (3) January 2024
- (3) December 2023
- (4) November 2023
- (5) October 2023
- (10) September 2023
- (8) August 2023
- (1) June 2023
- (1) May 2023
- (4) April 2023
- (5) March 2023