Skip to content

Commit 73e06e9

Browse files
Upgrade rand crate from 0.9 to 0.10 version (#1365)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kai Ren <tyranron@gmail.com>
1 parent 8b919af commit 73e06e9

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

juniper_actix/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async-stream = "0.3"
4949
env_logger = "0.11"
5050
juniper = { version = "0.17", path = "../juniper", features = ["expose-test-schema"] }
5151
log = "0.4"
52-
rand = "0.9"
52+
rand = "0.10"
5353
tokio = "1.0"
5454

5555
[lints.clippy]

juniper_actix/examples/subscription.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,16 @@ impl Subscription {
8686
Second result will be an error."
8787
)]
8888
async fn random_human(context: &Database) -> RandomHumanStream {
89-
use rand::{Rng as _, SeedableRng as _, rngs::StdRng};
89+
use rand::{
90+
RngExt as _, SeedableRng as _,
91+
rngs::{StdRng, SysRng},
92+
};
9093

9194
let mut counter = 0;
9295

9396
let context = (*context).clone();
9497

95-
let mut rng = StdRng::from_os_rng();
98+
let mut rng = StdRng::try_from_rng(&mut SysRng).unwrap();
9699
let mut interval = tokio::time::interval(Duration::from_secs(5));
97100
let stream = async_stream::stream! {
98101
counter += 1;

0 commit comments

Comments
 (0)