Skip to content

Commit 5c5aea5

Browse files
committed
GH-15 # Update rand library
update rstest
1 parent 177105e commit 5c5aea5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ exclude = [
1616
[dependencies]
1717
pnet = "^0.35"
1818
hex = "^0.4"
19-
rand = "^0.8"
19+
rand = "^0.9"
2020
sha2 = "^0.10"
2121

2222
[dev-dependencies]
23-
rstest = "~0.22"
23+
rstest = "~0.24"

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
pub mod error;
22

3-
use rand::{thread_rng, Rng};
4-
use rand::seq::SliceRandom;
3+
use rand::Rng;
54
use std::str::FromStr;
65
use sha2::{Sha256, Digest};
76
use std::net::{SocketAddr, TcpStream, ToSocketAddrs};
87
use std::io::{Write, Read};
98
use std::time::Duration;
9+
use rand::seq::IndexedRandom;
1010
use crate::error::{DetailedError, JarmError};
1111

1212
const ALPN_EXTENSION: &[u8; 2] = b"\x00\x10";
@@ -762,8 +762,8 @@ impl JarmRng for TestRng { // Mocked Rng used in tests
762762

763763
impl JarmRng for PseudoRng { // Real Rng used outside of tests
764764
fn random_bytes(&self) -> Vec<u8> {
765-
let mut rng = thread_rng();
766-
rng.gen::<[u8; 32]>().to_vec()
765+
let mut rng = rand::rng();
766+
rng.random::<[u8; 32]>().to_vec()
767767
}
768768

769769
fn random_grease(&self) -> Vec<u8> {
@@ -785,7 +785,7 @@ impl JarmRng for PseudoRng { // Real Rng used outside of tests
785785
b"\xea\xea".to_vec(),
786786
b"\xfa\xfa".to_vec(),
787787
];
788-
grease_list.choose(&mut rand::thread_rng()).unwrap().clone()
788+
grease_list.choose(&mut rand::rng()).unwrap().clone()
789789
}
790790
}
791791

0 commit comments

Comments
 (0)