diff --git a/src/main.rs b/src/main.rs index 5f5fd23..ab195e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,11 +60,10 @@ fn reset_prepare(config: &Ldap0rConfig, keys: &Keys, email_address: &str) -> Res if rs.len() == 1 { // generate key - let mut key = String::with_capacity(64); let mut rng = rand::thread_rng(); - for _ in 0..64 { - key.push(BASE62[rng.gen::() % 62] as char); - } + let key: String = (0..64) + .map(|_| BASE62[rng.gen::() % 62] as char) + .collect(); // store key with id let keys = Arc::clone(&keys.keys);