(no title)
carlmr | 1 month ago
There's a simple trick to avoid that, use `.clone()` more and use fewer references.
In C++ you would be probably copying around even more data unnecessarily before optimization. In Rust everything is move by default. A few clones here and there can obviate the need to think about lifetimes everywhere and put you roughly on par with normal C++.
You can still optimize later when you solved the problem.
eddd-ddde|1 month ago
Another option is to just use cells and treat the execution model similarly to JavaScript where mutation is limited specific scopes.