Skip to content

Commit

Permalink
Use dynamic string for error
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-garcia committed Dec 15, 2023
1 parent bb12328 commit 1da5854
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bitwarden/src/tool/generators/passphrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl PassphraseGeneratorRequest {

if !(MINIMUM_PASSPHRASE_NUM_WORDS..=MAXIMUM_PASSPHRASE_NUM_WORDS).contains(&self.num_words)
{
return Err("'num_words' must be between 3 and 20".into());
return Err(format!("'num_words' must be between {MINIMUM_PASSPHRASE_NUM_WORDS} and {MAXIMUM_PASSPHRASE_NUM_WORDS}").into());
}

if self.word_separator.chars().next().is_none() {
Expand Down

0 comments on commit 1da5854

Please sign in to comment.