Switch from unwrap() to expect()
This commit is contained in:
parent
10411bbdcb
commit
04f1e48564
@ -44,9 +44,9 @@ fn main() {
|
|||||||
let mut new_password = String::new();
|
let mut new_password = String::new();
|
||||||
for _ in 0..new_password_length {
|
for _ in 0..new_password_length {
|
||||||
new_password.push(
|
new_password.push(
|
||||||
allowed_chars.chars()
|
*allowed_chars_set.iter()
|
||||||
.nth(rng.next_u32() as usize % allowed_chars.len())
|
.nth(rng.next_u32() as usize % allowed_chars_set.len())
|
||||||
.unwrap()
|
.expect("Error: Invalid index")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user