diff --git a/async-openai/Cargo.toml b/async-openai/Cargo.toml index 436e7534..3355972a 100644 --- a/async-openai/Cargo.toml +++ b/async-openai/Cargo.toml @@ -31,7 +31,7 @@ async-openai-macros = { path = "../async-openai-macros", version = "0.1.0" } backoff = { version = "0.4.0", features = ["tokio"] } base64 = "0.22.1" futures = "0.3.31" -rand = "0.8.5" +rand = "0.9.0" reqwest = { version = "0.12.12", features = [ "json", "stream", diff --git a/async-openai/src/download.rs b/async-openai/src/download.rs index 087ba6f3..e3d9a1e4 100644 --- a/async-openai/src/download.rs +++ b/async-openai/src/download.rs @@ -1,7 +1,7 @@ use std::path::{Path, PathBuf}; use base64::{engine::general_purpose, Engine as _}; -use rand::{distributions::Alphanumeric, Rng}; +use rand::{distr::Alphanumeric, Rng}; use reqwest::Url; use crate::error::OpenAIError; @@ -57,7 +57,7 @@ pub(crate) async fn download_url>( } pub(crate) async fn save_b64>(b64: &str, dir: P) -> Result { - let filename: String = rand::thread_rng() + let filename: String = rand::rng() .sample_iter(&Alphanumeric) .take(10) .map(char::from)