-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Copy for Coin / Vec<Coin> #77
Comments
I think The code was fine, I just forgot that we needed to use it twice. |
Fair enough. I think you can always implement you own Copy trait, though. Basically, by recreating all the objects that are pointers / references in your structs. This is what C++ copy constructors / copy-assignment operators do, by the way. |
Currently when coins are sent in a message's
sent_funds
, they need to be cloned in order to be used independently of the containing struct (env
/env.message
). This makes some code constructs unnatural (or imply extra cloning of the whole structure).See by example the discussion in #72 (comment) .
Rust errors E0382 / E0505 suggest as an alternative implementing the Copy trait, for the members that need to be accessed independently.
The text was updated successfully, but these errors were encountered: