3 ms·
Yep. And it's not necessary for a language to be pure to get that benefit on a per method basis. Rust is OOP but you define in the method signature whether or
by ChrisSD 7y ago
Yep. And it's not necessary for a language to be pure to get that benefit on a per method basis.
Rust is OOP but you define in the method signature whether or not that method mutates state. So if a method has the signature that includes `&self`, you know it doesn't mutate. Whereas `&mut self` indicates that it does (or at least could).