We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b231ac2 commit 23fc4a1Copy full SHA for 23fc4a1
src/rngs/os.rs
@@ -25,7 +25,7 @@ pub struct OsRng;
25
26
impl OsRng {
27
/// Create a new `OsRng`.
28
- #[deprecated(since="0.2.0", note="replace OsRng::new().unwrap() with just OsRng")]
+ #[deprecated(since="0.7.0", note="replace OsRng::new().unwrap() with just OsRng")]
29
pub fn new() -> Result<OsRng, Error> {
30
Ok(OsRng)
31
}
@@ -49,10 +49,6 @@ impl RngCore for OsRng {
49
50
51
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> {
52
- // Some systems do not support reading 0 random bytes.
53
- // (And why waste a system call?)
54
- if dest.len() == 0 { return Ok(()); }
55
-
56
getrandom(dest).map_err(|e|
57
Error::with_cause(ErrorKind::Unavailable, "OsRng failed", e))
58
0 commit comments