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