Skip to content

Commit ae56d7c

Browse files
authored
fix: Update multiple dependencies (#114)
1 parent 06bb4f3 commit ae56d7c

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

launchdarkly-server-sdk/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ features = ["event-compression"]
2020
chrono = "0.4.19"
2121
crossbeam-channel = "0.5.1"
2222
data-encoding = "2.3.2"
23-
eventsource-client = { version = "0.13.0", default-features = false }
23+
eventsource-client = { version = "0.14.0", default-features = false }
2424
futures = "0.3.12"
2525
lazy_static = "1.4.0"
2626
log = "0.4.14"
27-
lru = { version = "0.12.0", default-features = false }
27+
lru = { version = "0.13.0", default-features = false }
2828
ring = "0.17.5"
2929
launchdarkly-server-sdk-evaluation = "2.0.0"
3030
serde = { version = "1.0.132", features = ["derive"] }
3131
serde_json = { version = "1.0.73", features = ["float_roundtrip"] }
32-
thiserror = "1.0"
32+
thiserror = "2.0"
3333
tokio = { version = "1.17.0", features = ["rt-multi-thread"] }
3434
parking_lot = "0.12.0"
3535
tokio-stream = { version = "0.1.8", features = ["sync"] }
3636
moka = { version = "0.12.1", features = ["sync"] }
3737
uuid = {version = "1.2.2", features = ["v4"] }
3838
hyper = { version = "0.14.19", features = ["client", "http1", "http2", "tcp"] }
3939
hyper-rustls = { version = "0.24.1" , optional = true}
40-
rand = "0.8"
40+
rand = "0.9"
4141
flate2 = { version = "1.0.35", optional = true }
4242

4343
[dev-dependencies]

launchdarkly-server-sdk/src/events/dispatcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crossbeam_channel::{bounded, select, tick, Receiver, Sender};
2-
use rand::thread_rng;
2+
use rand::rng;
33
use std::time::SystemTime;
44

55
use launchdarkly_server_sdk_evaluation::Context;
@@ -89,7 +89,7 @@ impl EventDispatcher {
8989
last_known_time: 0,
9090
disabled: false,
9191
thread_count: 5,
92-
sampler: Box::new(ThreadRngSampler::new(thread_rng())),
92+
sampler: Box::new(ThreadRngSampler::new(rng())),
9393
}
9494
}
9595

launchdarkly-server-sdk/src/migrations/migrator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use futures::future::join_all;
66
use futures::future::BoxFuture;
77
use futures::future::FutureExt;
88
use launchdarkly_server_sdk_evaluation::Context;
9-
use rand::thread_rng;
9+
use rand::rng;
1010
use serde::Serialize;
1111

1212
use crate::sampler::Sampler;
@@ -219,7 +219,7 @@ where
219219
measure_errors,
220220
read_config,
221221
write_config,
222-
sampler: Box::new(ThreadRngSampler::new(thread_rng())),
222+
sampler: Box::new(ThreadRngSampler::new(rng())),
223223
}
224224
}
225225

launchdarkly-server-sdk/src/migrations/tracker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{
44
};
55

66
use launchdarkly_server_sdk_evaluation::{Context, Detail, Flag};
7-
use rand::thread_rng;
7+
use rand::rng;
88

99
use crate::{
1010
events::event::{BaseEvent, EventFactory, MigrationOpEvent},
@@ -78,7 +78,7 @@ impl MigrationOpTracker {
7878
/// A callable is provided in case sampling rules do not require consistency checking to run.
7979
/// In this case, we can avoid the overhead of a function by not using the callable.
8080
pub fn consistent(&mut self, is_consistent: impl Fn() -> bool) {
81-
if ThreadRngSampler::new(thread_rng()).sample(self.consistent_ratio.unwrap_or(1)) {
81+
if ThreadRngSampler::new(rng()).sample(self.consistent_ratio.unwrap_or(1)) {
8282
self.consistent = Some(is_consistent());
8383
}
8484
}

launchdarkly-server-sdk/src/sampler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl<R: Rng> Sampler for ThreadRngSampler<R> {
2424
return true;
2525
}
2626

27-
self.rng.gen_ratio(1, ratio)
27+
self.rng.random_ratio(1, ratio)
2828
}
2929
}
3030

@@ -36,13 +36,13 @@ mod tests {
3636

3737
#[test]
3838
fn test_zero_is_false() {
39-
let mut sampler = ThreadRngSampler::new(rand::thread_rng());
39+
let mut sampler = ThreadRngSampler::new(rand::rng());
4040
assert!(!sampler.sample(0));
4141
}
4242

4343
#[test]
4444
fn test_one_is_true() {
45-
let mut sampler = ThreadRngSampler::new(rand::thread_rng());
45+
let mut sampler = ThreadRngSampler::new(rand::rng());
4646
assert!(sampler.sample(1));
4747
}
4848

0 commit comments

Comments
 (0)