Switch from unwrap() to expect()

This commit is contained in:
Maximilian 2023-01-24 12:31:26 -06:00
parent 10411bbdcb
commit 04f1e48564

View File

@ -44,9 +44,9 @@ fn main() {
let mut new_password = String::new();
for _ in 0..new_password_length {
new_password.push(
allowed_chars.chars()
.nth(rng.next_u32() as usize % allowed_chars.len())
.unwrap()
*allowed_chars_set.iter()
.nth(rng.next_u32() as usize % allowed_chars_set.len())
.expect("Error: Invalid index")
);
}