Skip to content

Commit da0fa79

Browse files
authored
Update rand crate to 0.9.1 (#19)
1 parent 129fefd commit da0fa79

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories = [ "network-programming", "asynchronous" ]
1414
[dependencies]
1515
bytes = "1.5.0"
1616
fxhash = "0.2.1"
17-
rand = "0.8.5"
17+
rand = "0.9.1"
1818
slab = "0.4.9"
1919
thiserror = "2.0.16"
2020
log = "0.4.21"

src/endpoint/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ impl Endpoint {
7474
///
7575
/// Returns `Err` if the configuration is invalid.
7676
pub fn new(config: Arc<EndpointConfig>, server_config: Option<Arc<ServerConfig>>) -> Self {
77+
let rng = {
78+
let mut base = rand::rng();
79+
StdRng::from_rng(&mut base)
80+
};
7781
Self {
78-
rng: StdRng::from_entropy(),
82+
rng,
7983
transmits: VecDeque::new(),
8084
association_ids_init: HashMap::default(),
8185
association_ids: FxHashMap::default(),

src/param/param_state_cookie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl ParamStateCookie {
5151
pub(crate) fn new() -> Self {
5252
let mut cookie = BytesMut::new();
5353
cookie.resize(32, 0);
54-
rand::thread_rng().fill(cookie.as_mut());
54+
rand::rng().fill(cookie.as_mut());
5555

5656
ParamStateCookie {
5757
cookie: cookie.freeze(),

0 commit comments

Comments
 (0)