-
Notifications
You must be signed in to change notification settings - Fork 47
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
Copy or clone format? #12
Comments
This may not be possible to implement since the underlying library creates Format objects via the Workbook object so the interface would have to be something like: let mut format2 = workbook.clone(format1); Which unfortunately isn't very Rust like. |
you might be able to implement the actual attachment to the workbook via closure, which would allow Rust to treat it as a separate object. Would require a rewrite of the Format struct though, I think... |
Probably, and that is unlikely to happen in the C library because the workbook management/coupling design is too tight. Format cloning is supported in the pure Rust version however since I went with a decoupled design to avoid borrow/owner issues. |
I just looked into it more and it seems like Format is getting detached from the workbooks in 0.6 with Format::new()! So our problem is getting solved! |
I had another idea for doing this: |
Is it possible to copy or clone a format to avoid code repetition?
The text was updated successfully, but these errors were encountered: