diff --git a/Cargo.toml b/Cargo.toml index 7d95246..f9d2573 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ default-target = "x86_64-pc-windows-msvc" targets = ["aarch64-pc-windows-msvc", "i686-pc-windows-msvc", "x86_64-pc-windows-msvc"] [dependencies] -socket2 = "0.3.16" [dependencies.winapi] version = "0.3.3" @@ -39,4 +38,5 @@ features = [ ] [dev-dependencies] -rand = "0.4" +rand = "0.8.0" +socket2 = "0.3.18" diff --git a/src/lib.rs b/src/lib.rs index e1139a3..2719821 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,6 @@ #![allow(bad_style)] #![doc(html_root_url = "https://docs.rs/miow/0.3/x86_64-pc-windows-msvc/")] -extern crate socket2; extern crate winapi; #[cfg(test)] diff --git a/src/pipe.rs b/src/pipe.rs index 6192dd2..5088021 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -569,14 +569,18 @@ mod tests { use std::thread; use std::time::Duration; - use rand::{thread_rng, Rng}; + use rand::{distributions::Alphanumeric, thread_rng, Rng}; use super::{anonymous, NamedPipe, NamedPipeBuilder}; use crate::iocp::CompletionPort; use crate::Overlapped; fn name() -> String { - let name = thread_rng().gen_ascii_chars().take(30).collect::(); + let name = thread_rng() + .sample_iter(Alphanumeric) + .take(30) + .map(char::from) + .collect::(); format!(r"\\.\pipe\{}", name) }