Skip to content

Commit

Permalink
Replace deprecated thread_rng with rng
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Mar 6, 2025
1 parent 5e380de commit e52b00c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/random.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::slice::from_raw_parts_mut;

use libc::c_void;
use rand::{random, thread_rng, RngCore};
use rand::{random, rng, RngCore};

/// Generates random `uint8_t`.
#[no_mangle]
Expand Down Expand Up @@ -35,5 +35,5 @@ pub unsafe extern "C" fn z_random_fill(buf: *mut c_void, len: usize) {
return;
}
let b: &mut [u8] = from_raw_parts_mut(buf as *mut u8, len);
thread_rng().fill_bytes(b);
rng().fill_bytes(b);
}

0 comments on commit e52b00c

Please sign in to comment.