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

feat: implement Clone for TranslationOptions #4

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

0x6b
Copy link
Contributor

@0x6b 0x6b commented Mar 16, 2023

First of all, thanks for making the crate open!


Since the struct does not implement the trait, it's difficult to reuse the same options across multiple requests.

The another way might include to provided a custom copy or a new method that takes a reference to the original struct, and creates a new with the same data. But since the struct (1) does not contain any reference, (2) does not contain fields which is hard or impossible to clone such as I/O resources, and (3) is a fairly small so that the cost of clone is negligible.

Please let me know your thoughts. Thanks!

0x6b added 2 commits March 16, 2023 09:43
Since the struct does not implement the trait, it's difficult to reuse
the same options across multiple requests. The another way might include
to provided a custom `copy` or a `new` method that takes a reference to
the original struct, and creates a new with the same data. But since the
struct (1) does not contain any reference, (2) does not contain fields
which is hard or impossible to clone such as I/O resources, and (3) is a
fairly small so that the cost of clone is negligible.
clap-rs/clap#4602 changed the start of the error messages to lower case.
Since the change is trivial, I included this into the same PR.

Ref.: clap-rs/clap#4602
@mgruner mgruner merged commit 48910a5 into mgruner:next Mar 16, 2023
@mgruner
Copy link
Owner

mgruner commented Mar 16, 2023

🙏 Released as v0.4.1.

@0x6b
Copy link
Contributor Author

0x6b commented Mar 16, 2023

Thank you for the prompt action!

@0x6b 0x6b deleted the impl-copy-trait branch March 16, 2023 11:22
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.

2 participants