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

Would it make sense to introduce a ShallowClone trait with Clone as a subtrait? ShallowClone would be almost like a marker trait and it would provide the method shallow_clone which may call clone by default. If people see that both ShallowClone and Clone is implemented for a type, then they can infer that the type is cheaply cloneable #232

Open
apoelstra opened this issue Jul 4, 2024 · 1 comment

Comments

@apoelstra
Copy link
Collaborator

          8eeab8f2e6dc61eba299e57b282ecf677a9bce0a: Would it make sense to introduce a `ShallowClone` trait with `Clone` as a subtrait? `ShallowClone` would be almost like a marker trait and it would provide the method `shallow_clone` which may call `clone` by default. If people see that both `ShallowClone` and `Clone` is implemented for a type, then they can infer that the type is cheaply cloneable

Originally posted by @uncomputable in #231 (comment)

@apoelstra
Copy link
Collaborator Author

Yep, I like this idea.

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

1 participant