2 ms·
If you didn't want a to be mutated, you'd make it const in the beginning :) Rust makes it much harder to make these kinds of erros by making variable ownership
by btown 10y ago
If you didn't want a to be mutated, you'd make it const in the beginning :)
Rust makes it much harder to make these kinds of erros by making variable ownership, reference lifetime, and const-by-default core to the language design. https://doc.rust-lang.org/book/ownership.html https://doc.rust-lang.org/book/ownership.html ... You do end up spending a lot of time "fighting the compiler," even compared to template-heavy C++ codebases, but the systems you create are free from an entire class of errors.