Skip to content

Commit 87597cc

Browse files
committed
fix: use Rng::fill instead of Rng::random for rand 0.9/0.10 compat
Rng::random() was removed in newer rand versions. Rng::fill() is stable across both 0.9 and 0.10.
1 parent 46327a4 commit 87597cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/mcp/oauth/token.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ pub struct TokenResponse {
5858
/// Generate an opaque refresh token.
5959
fn generate_refresh_token() -> String {
6060
use rand::Rng as _;
61-
let bytes: [u8; 32] = rand::rng().random();
61+
let mut bytes = [0u8; 32];
62+
rand::rng().fill(&mut bytes);
6263
base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(bytes)
6364
}
6465

0 commit comments

Comments
 (0)