by VWWHFSfQ · 1y ago · 0 comments
I struggled with this as well when I first started programming Rust. Until I got some great advice on the rust-users forum one day: just clone.
You don't have to struggle with the borrow checker, lifetimes, or anything else if you don't want to. Just clone everything. It's usually all your Pythons, Gos, and anything else with a GC is doing anyway. Clippy will tell you the easy places you can fix it. And when you get better and more confident, then you'll spot it yourself too.
So just clone, who cares. The RAII is going to clean up after you no matter what.
GC langs don't do clones (copying), that's the point of the GC.