3 ms·
Maybe check out one of the existing string interning modules? There are some good ones. I believe it's common to internally use indexes instead of references to
by nicoburns 5y ago
Maybe check out one of the existing string interning modules? There are some good ones. I believe it's common to internally use indexes instead of references to get around the borrow checker in these kind of situations.
- Dzugaru 5y agoThat's my impression with Rust for now - you use indexes instead and borrow as needed. Long lived borrows are a no go, I was shocked to figure out you cannot return a new thing and a reference to it from a function.
- deleted 5y ago[deleted]