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

Derive Clone for Package #64

Open
ljedrz opened this issue Jun 15, 2018 · 0 comments
Open

Derive Clone for Package #64

ljedrz opened this issue Jun 15, 2018 · 0 comments

Comments

@ljedrz
Copy link
Contributor

ljedrz commented Jun 15, 2018

Consider a case where a template XML is used to produce several other XMLs with different modifications; it seems that at this moment this requires the template to be parsed as many times as the number of desired target XMLs, because Package doesn't implement Clone and cloneing a Document merely copies the references to the parent Package, which doesn't provide a fresh copy of the parsed structure. Having to parse the same file several times is pretty inefficient - cloning Packages would be much faster.

I tried to #[derive(Clone)] for Package myself, but I encountered an issue: typed_arena::Arena isn't Cloneable either. Is there any way around this?

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