From 0ce14186ba5f569fc7d6ccab25c4708ae3ec9503 Mon Sep 17 00:00:00 2001 From: jokemanfire Date: Mon, 26 May 2025 18:58:33 +0800 Subject: [PATCH] chore(deps): update rand requirement from 0.8 to 0.9 (#226) Signed-off-by: jokemanfire --- examples/clients/Cargo.toml | 2 +- examples/servers/Cargo.toml | 2 +- examples/servers/src/mcp_oauth_server.rs | 4 ++-- examples/transport/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/clients/Cargo.toml b/examples/clients/Cargo.toml index aa743a0..2461684 100644 --- a/examples/clients/Cargo.toml +++ b/examples/clients/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -rand = "0.8" +rand = "0.9" futures = "0.3" anyhow = "1.0" url = "2.4" diff --git a/examples/servers/Cargo.toml b/examples/servers/Cargo.toml index 7c3a952..52c0ac4 100644 --- a/examples/servers/Cargo.toml +++ b/examples/servers/Cargo.toml @@ -19,7 +19,7 @@ tracing-subscriber = { version = "0.3", features = [ "fmt", ] } futures = "0.3" -rand = { version = "0.8", features = ["std"] } +rand = { version = "0.9", features = ["std"] } axum = { version = "0.8", features = ["macros"] } schemars = { version = "0.8", optional = true } reqwest = { version = "0.12", features = ["json"] } diff --git a/examples/servers/src/mcp_oauth_server.rs b/examples/servers/src/mcp_oauth_server.rs index a1060ec..7548865 100644 --- a/examples/servers/src/mcp_oauth_server.rs +++ b/examples/servers/src/mcp_oauth_server.rs @@ -11,7 +11,7 @@ use axum::{ response::{Html, IntoResponse, Redirect, Response}, routing::{get, post}, }; -use rand::{Rng, distributions::Alphanumeric}; +use rand::{Rng, distr::Alphanumeric}; use rmcp::transport::{ SseServer, auth::{ @@ -216,7 +216,7 @@ struct UserInfo { } fn generate_random_string(length: usize) -> String { - rand::thread_rng() + rand::rng() .sample_iter(&Alphanumeric) .take(length) .map(char::from) diff --git a/examples/transport/Cargo.toml b/examples/transport/Cargo.toml index 7c6382a..0130603 100644 --- a/examples/transport/Cargo.toml +++ b/examples/transport/Cargo.toml @@ -35,7 +35,7 @@ tracing-subscriber = { version = "0.3", features = [ "fmt", ] } futures = "0.3" -rand = { version = "0.8" } +rand = { version = "0.9" } schemars = { version = "0.8", optional = true } hyper = { version = "1", features = ["client", "server", "http1"] } hyper-util = { version = "0.1", features = ["tokio"] }