News for hackers. Stuff that matters.
Re:Writing Pythonic Rust by nicoburns on Monday May 24, 2021 @04:00PM (#27269002)
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.
Re:Writing Pythonic Rust by Dzugaru on Monday May 24, 2021 @04:15PM (#27269178)
That'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.