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

Implement generic Struct#clone #4178

Closed
wants to merge 1 commit into from

Conversation

Sija
Copy link
Contributor

@Sija Sija commented Mar 23, 2017

Followup to PR #4174 adding Struct#clone (internally calling #dup).

@bcardiff
Copy link
Member

You don't wait :-)
clone should perform a deep copy

@Sija
Copy link
Contributor Author

Sija commented Mar 23, 2017

Sorry, too much ☕️ today turned my fast&furious mode ;) I was considering using def_clone, would that be sensible?

@Sija
Copy link
Contributor Author

Sija commented Mar 23, 2017

CI is failing because of a bug?

@asterite
Copy link
Member

Just in case, read this

It was previously decided that no generic clone method will be provided. That it was missing in Time (and probably in other types in the standard library) is not a good reason to provide a generic implementation for this. Cloning every member isn't always what you want, so forcing an implementation when needed is better.

@Sija
Copy link
Contributor Author

Sija commented Mar 23, 2017

@asterite I was thinking the same, Struct#clone sounded like a big generalization, that's why I started with #4174.

@bcardiff
Copy link
Member

Ok, my bad for suggesting a generic clone implementation for structs. Let's stay just with #4174.
I forgot about that conversation.

@bcardiff bcardiff closed this Mar 23, 2017
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

Successfully merging this pull request may close these issues.

None yet

3 participants