Skip to content
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

Remove unnecessary clones from metadata #119

Open
jonjove opened this issue Aug 4, 2022 · 4 comments
Open

Remove unnecessary clones from metadata #119

jonjove opened this issue Aug 4, 2022 · 4 comments

Comments

@jonjove
Copy link
Contributor

jonjove commented Aug 4, 2022

No description provided.

@leighmcculloch
Copy link
Member

leighmcculloch commented Aug 8, 2022

Is this related to SDK types not being Copy? I'm starting to think we should consider making all the SDK types Copy, given that the SDK types are mostly backed by a u64. Unsure if that has drawbacks though. cc @graydon

@jonjove
Copy link
Contributor Author

jonjove commented Aug 8, 2022

Not really, there are just some places where a clone was made but you could have just moved. For example, https://github.com/stellar/soroban-token-contract/blob/44127bca3ee1dcf3d8107db6fa60077e7ec3dff8/src/metadata.rs#L14-L17

I've also wondered about making everything Copy, and think it could have benefits. There might also be disadvantages though.

@leighmcculloch
Copy link
Member

I've also wondered about making everything Copy, and think it could have benefits.

Unfortunately plenty of SDK types, the ones that embed Env, cannot be Copy because the Env contains an Rc<>. It would be nice if we could make some of the types Copy, especially types like BigInt.

@jonjove
Copy link
Contributor Author

jonjove commented Sep 20, 2022

This is already done in the built-in token contract but is not done in the example token contract.

@sisuresh sisuresh transferred this issue from stellar-deprecated/soroban-token-contract Sep 20, 2022
@jonjove jonjove removed their assignment Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@leighmcculloch @jonjove and others