aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/util.rs b/src/util.rs
index fdb73c3..a5dd1e5 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -77,9 +77,8 @@ pub fn get_last_error() -> Error {
}
pub fn generate_password(length: usize) -> Result<Vec<u8>, Error> {
- let mut rng = OsRng::new().map_err(|err| Error::RandError(Box::new(err)))?;
let mut data = vec![0u8; length];
- rng.fill_bytes(&mut data[..]);
+ OsRng.fill_bytes(&mut data[..]);
Ok(data)
}