3 ms·
Exactly. And for function parameters, rust also (usually) makes it obvious when you’re passing by value, by reference or by mutable reference: foo(x); // M
by josephg 2y ago
Exactly. And for function parameters, rust also (usually) makes it obvious when you’re passing by value, by reference or by mutable reference:
foo(x); // Moves or copies
foo(&x); // immutable reference
foo(&mut x); // mutable reference
I don’t need to look up the signature of foo to understand what happens to my variable. It’s obvious at a glance.
- recursive 2y agoFair point. I guess this is the cost of dynamic languages.