From 1da5854234a425923ff91b3e88d428002afdf7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garci=CC=81a?= Date: Fri, 15 Dec 2023 11:55:11 +0100 Subject: [PATCH] Use dynamic string for error --- crates/bitwarden/src/tool/generators/passphrase.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bitwarden/src/tool/generators/passphrase.rs b/crates/bitwarden/src/tool/generators/passphrase.rs index 65160bb3a..5abad368b 100644 --- a/crates/bitwarden/src/tool/generators/passphrase.rs +++ b/crates/bitwarden/src/tool/generators/passphrase.rs @@ -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() {