|
|
|
|
|
by tuetuopay
1311 days ago
|
|
I have yet to come on structs that implement `Copy` while being expensive to actually copy. The largest I can think of is `Uuid` from the `uuid` crate, which is 128 bits in size. This is a single word copy for most machines since modern hardware has 128 bit support for case like this. Still, two 64-bit words to copy is definitely negligible: that's equivalent of copying two pointers. I agree with you for the garbage collector. By design, a GC allows you to willy-nilly copy without thinking about the consequences. |
|