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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub struct LanguageInformation {
}

/// Translation option that controls the splitting of sentences before the translation.
#[derive(Clone)]
pub enum SplitSentences {
/// Don't split sentences.
None,
Expand All @@ -77,6 +78,7 @@ pub enum SplitSentences {
}

/// Translation option that controls the desired translation formality.
#[derive(Clone)]
pub enum Formality {
/// Default formality.
Default,
Expand All @@ -87,6 +89,7 @@ pub enum Formality {
}

/// Custom [flags for the translation request](https://www.deepl.com/docs-api/translating-text/request/).
#[derive(Clone)]
pub struct TranslationOptions {
/// Sets whether the translation engine should first split the input into sentences. This is enabled by default.
pub split_sentences: Option<SplitSentences>,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn test_translate() {
.code(2)
.stdout(predicate::eq(""))
.stderr(predicate::str::contains(
"error: The following required arguments were not provided:",
"error: the following required arguments were not provided:",
));

// STDIN/STDOUT
Expand Down