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

Make Document and Header derive Clone #78

Open
blagovestb2c2 opened this issue Jul 31, 2021 · 2 comments
Open

Make Document and Header derive Clone #78

blagovestb2c2 opened this issue Jul 31, 2021 · 2 comments

Comments

@blagovestb2c2
Copy link

Hello, it's a simple request, but is there any reason why these two structures don't derive Clone. I'm trying to return by value and I'm struggling a bit how to get an owned Document out of the local results vector

@blagovestb2c2
Copy link
Author

I found out how to solve my problem using Vec::swap_remove, but I still wonder about Clone (maybe even Eq/PartialEq?)

@fMeow
Copy link
Owner

fMeow commented Aug 18, 2021

Well, I am a little against the idea to add Clone to Document and Header. Say we have a document and a cloned document, and we made different changes in these two documents, then it can be inconsistent when you update it in arangodb. The liability can be passed to the user of arangors to avoid such cases, but I think it better to avoid it in the first place.

As for your use case, I think the local results is mutable and so you can just move the ownership of the element in a vec to another variable.

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

2 participants