diff --git a/Cargo.lock b/Cargo.lock index 84629860..3dff7b05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,6 @@ dependencies = [ "actix-http", "actix-web", "actix-web-lab", - "base64", "blake2", "blake3", "digest", @@ -71,7 +70,6 @@ dependencies = [ "futures-core", "futures-util", "hex-literal", - "local-channel", "md-5", "md4", "pin-project-lite", @@ -79,7 +77,6 @@ dependencies = [ "sha2", "sha3", "subtle", - "tokio", "tracing", ] @@ -114,7 +111,7 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", - "rand", + "rand 0.8.5", "sha1", "smallvec", "tokio", @@ -356,10 +353,9 @@ dependencies = [ "impl-more", "itertools 0.14.0", "local-channel", - "mediatype", "mime", "pin-project-lite", - "rand", + "rand 0.9.0", "regex", "rmp-serde", "rustls", @@ -386,7 +382,6 @@ dependencies = [ "actix-web", "actix-web-lab", "futures-util", - "proc-macro2", "quote", "rustversion", "syn", @@ -422,10 +417,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.15", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -608,7 +603,7 @@ dependencies = [ "openssl", "percent-encoding", "pin-project-lite", - "rand", + "rand 0.8.5", "rustls", "serde", "serde_json", @@ -1323,7 +1318,19 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", ] [[package]] @@ -1908,12 +1915,6 @@ dependencies = [ "digest", ] -[[package]] -name = "mediatype" -version = "0.19.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8878cd8d1b3c8c8ae4b2ba0a36652b7cf192f618a599a7fbdfa25cffd4ea72dd" - [[package]] name = "memchr" version = "2.7.4" @@ -1969,7 +1970,7 @@ dependencies = [ "hermit-abi", "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -2181,7 +2182,7 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -2219,8 +2220,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.0", + "zerocopy 0.8.17", ] [[package]] @@ -2230,7 +2242,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.0", ] [[package]] @@ -2239,7 +2261,17 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", +] + +[[package]] +name = "rand_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +dependencies = [ + "getrandom 0.3.1", + "zerocopy 0.8.17", ] [[package]] @@ -2339,7 +2371,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin", "untrusted", @@ -2670,7 +2702,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -3197,6 +3229,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" version = "0.2.95" @@ -3429,6 +3470,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + [[package]] name = "write16" version = "1.0.0" @@ -3472,7 +3522,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa91407dacce3a68c56de03abe2760159582b846c6a4acd2f456618087f12713" +dependencies = [ + "zerocopy-derive 0.8.17", ] [[package]] @@ -3486,6 +3545,17 @@ dependencies = [ "syn", ] +[[package]] +name = "zerocopy-derive" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06718a168365cad3d5ff0bb133aad346959a2074bd4a85c121255a11304a8626" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zerofrom" version = "0.1.5" diff --git a/actix-hash/Cargo.toml b/actix-hash/Cargo.toml index d6b6571d..c030334f 100644 --- a/actix-hash/Cargo.toml +++ b/actix-hash/Cargo.toml @@ -47,9 +47,7 @@ actix-web = { version = "4", default-features = false } actix-web-lab = "0.23" futures-core = "0.3.17" futures-util = { version = "0.3.31", default-features = false, features = ["std"] } -local-channel = "0.1" pin-project-lite = "0.2" -tokio = { version = "1.43.0", features = ["sync", "macros"] } tracing = { version = "0.1.41", features = ["log"] } blake2 = { package = "blake2", version = "0.10", optional = true } @@ -64,7 +62,6 @@ subtle = "2" [dev-dependencies] actix-web = "4" -base64 = "0.22" env_logger = "0.11" hex-literal = "0.4" sha2 = "0.10" diff --git a/actix-web-lab-derive/Cargo.toml b/actix-web-lab-derive/Cargo.toml index cce20ec9..78ba861c 100644 --- a/actix-web-lab-derive/Cargo.toml +++ b/actix-web-lab-derive/Cargo.toml @@ -19,7 +19,6 @@ rust-version.workspace = true proc-macro = true [dependencies] -proc-macro2 = "1" quote = "1" syn = { version = "2", features = ["full", "parsing"] } diff --git a/actix-web-lab/Cargo.toml b/actix-web-lab/Cargo.toml index af1ca2c6..c663a23f 100644 --- a/actix-web-lab/Cargo.toml +++ b/actix-web-lab/Cargo.toml @@ -66,7 +66,6 @@ http = "0.2.7" impl-more = "0.1.9" itertools = "0.14" local-channel = "0.1" -mediatype = "0.19" mime = "0.3" pin-project-lite = "0.2.16" regex = "1.11.0" @@ -101,7 +100,7 @@ generic-array = "0.14" hex = "0.4" hex-literal = "0.4" hmac = { version = "0.12", features = ["reset"] } -rand = "0.8" +rand = "0.9" rustls = "0.23" rustls-pemfile = "2" serde = { version = "1", features = ["derive"] } diff --git a/actix-web-lab/examples/ndjson.rs b/actix-web-lab/examples/ndjson.rs index ab7eef94..f331c435 100644 --- a/actix-web-lab/examples/ndjson.rs +++ b/actix-web-lab/examples/ndjson.rs @@ -16,7 +16,10 @@ use actix_web::{ use actix_web_lab::respond::NdJson; use futures_core::Stream; use futures_util::{stream, StreamExt as _}; -use rand::{distributions::Alphanumeric, Rng as _}; +use rand::{ + distr::{Alphanumeric, SampleString as _}, + Rng as _, +}; use serde::Deserialize; use serde_json::json; use tracing::info; @@ -98,19 +101,11 @@ async fn main() -> io::Result<()> { } fn random_email() -> String { - let rng = rand::thread_rng(); - - let id: String = rng - .sample_iter(Alphanumeric) - .take(10) - .map(char::from) - .collect(); - + let id = Alphanumeric.sample_string(&mut rand::rng(), 10); format!("user_{id}@example.com") } fn random_address() -> String { - let mut rng = rand::thread_rng(); - let street_no: u16 = rng.gen_range(10..99); + let street_no: u16 = rand::rng().random_range(10..=99); format!("{street_no} Random Street") }