2 ms·
You can copy in Rust too. You just call .clone(), or if you want your type to always be copied, have it implement the Copy trait. In that case, it does exactly
by wtetzner 9y ago
You can copy in Rust too. You just call .clone(), or if you want your type to always be copied, have it implement the Copy trait. In that case, it does exactly what you want.
But Rust is more explicit about copying in general, to make it harder for the performance cost to be hidden.