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 a73ee9d commit f2cd720Copy full SHA for f2cd720
src/oid.rs
@@ -14,7 +14,7 @@ use std::{convert::TryInto, time::SystemTime};
14
15
use hex::{self, FromHexError};
16
use once_cell::sync::Lazy;
17
-use rand::{thread_rng, Rng};
+use rand::{random, thread_rng, Rng};
18
19
const TIMESTAMP_SIZE: usize = 4;
20
const PROCESS_ID_SIZE: usize = 5;
@@ -253,7 +253,7 @@ impl ObjectId {
253
254
/// Generate a random 5-byte array.
255
fn gen_process_id() -> [u8; 5] {
256
- static BUF: Lazy<[u8; 5]> = Lazy::new(|| thread_rng().gen());
+ static BUF: Lazy<[u8; 5]> = Lazy::new(random);
257
258
*BUF
259
}
0 commit comments