diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-03 00:23:13 +0000 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-03 01:24:00 +0100 |
commit | 248f8b209b0150e70e82ab15b73bf32b0f47341d (patch) | |
tree | 2c18d6e200bd258883cb5bf08962db8690bac66c /src/auth.rs | |
parent | 52afed9c6a17ec9c120a5a91b445afa74be87f0e (diff) | |
download | nitrokey-rs-248f8b209b0150e70e82ab15b73bf32b0f47341d.tar.gz nitrokey-rs-248f8b209b0150e70e82ab15b73bf32b0f47341d.tar.bz2 |
Remove CommandError::RngError
We switched to rand::thread_rng() which cannot fail. Therefore the
CommandError::RngError is no longer needed and removed in this patch.
Diffstat (limited to 'src/auth.rs')
-rw-r--r-- | src/auth.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/auth.rs b/src/auth.rs index 017cdbb..a129bd8 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -149,10 +149,7 @@ where A: AuthenticatedDevice<D>, T: Fn(*const i8, *const i8) -> c_int, { - let temp_password = match generate_password(TEMPORARY_PASSWORD_LENGTH) { - Ok(pw) => pw, - Err(_) => return Err((device, CommandError::RngError)), - }; + let temp_password = generate_password(TEMPORARY_PASSWORD_LENGTH); let password = match get_cstring(password) { Ok(password) => password, Err(err) => return Err((device, err)), |