Fluss project: RefCell or not RefCell?


I am currently learning Rust, by doing a project, and I would like to have a little help. It would be nice if you could have a look to the entire project in order to catch all the mistakes I could have done but I suppose, that like me, your time is not unlimited and so I've created a ticket to list the biggest problem I currently face. In fact, I does feel it is an overhead but I can't judge.

The link to the code review issue: https://github.com/cedeber/fluss/issues/5

Thanks a lot for your help and your time.
Take care of you.

I provided a solution on your github ticket. Here's what I did.

The UiState struct borrows two Option<String>s, and this struct lives across a for loop that mutates the Option<String>s. The RefCell is used here to keep the UiState alive unnecessarily. The simplest solution is to drop the UiState and recreate it later. This re-creation should be very cheap since UiState is just a couple of pointers.

1 Like

Cool, thanks. I'll have a look.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.