Skip to content

Commit

Permalink
allow empty word separator in passphrases (#597)
Browse files Browse the repository at this point in the history
Allow the passphrase word separator to be the empty string `''`. 

This change recently merged [in the clients
repository](bitwarden/clients@bb031f6).
  • Loading branch information
audreyality authored Feb 12, 2024
1 parent 8bed619 commit ff57485
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/bitwarden-generators/src/passphrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use crate::util::capitalize_first_letter;
pub enum PassphraseError {
#[error("'num_words' must be between {} and {}", minimum, maximum)]
InvalidNumWords { minimum: u8, maximum: u8 },
#[error("'word_separator' cannot be empty")]
EmptyWordSeparator,
}

/// Passphrase generator request options.
Expand Down Expand Up @@ -69,10 +67,6 @@ impl PassphraseGeneratorRequest {
});
}

if self.word_separator.chars().next().is_none() {
return Err(PassphraseError::EmptyWordSeparator);
};

Ok(ValidPassphraseGeneratorOptions {
num_words: self.num_words,
word_separator: self.word_separator,
Expand Down

0 comments on commit ff57485

Please sign in to comment.