3 ms·
1) he should pass by reference to avoid the extra copy. So in his example yes it’s dev naivety 2) but somewhere somehow this object will deallocate, so his tri
by sockgrant 6y ago
1) he should pass by reference to avoid the extra copy. So in his example yes it’s dev naivety
2) but somewhere somehow this object will deallocate, so his trick of putting it to another thread would work if the deal location takes awhile. Same for cpp if you have a massive object in a unique ptr. So it’s not a rust issue
- renewiltord 6y agoWhere's the extra copy? I don't see one. He's moving the struct into the function, getting size and then dropping it.
- VWWHFSfQ 6y ago> avoid the extra copy there is no copy happening here