diff --git a/Cargo.toml b/Cargo.toml index 063097ab14..f2ed0b0684 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ cc = "1" [dev-dependencies] bytes = "0.4.8" lazy_static = "1" -rand = "0.4" +rand = "0.5" tempfile = "3" [target.'cfg(target_os = "freebsd")'.dev-dependencies] diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs index 8d584985cb..3e4fc28ceb 100644 --- a/test/sys/test_uio.rs +++ b/test/sys/test_uio.rs @@ -1,6 +1,7 @@ use nix::sys::uio::*; use nix::unistd::*; use rand::{thread_rng, Rng}; +use rand::distributions::Alphanumeric; use std::{cmp, iter}; use std::fs::{OpenOptions}; use std::os::unix::io::AsRawFd; @@ -11,7 +12,7 @@ use tempfile::{tempfile, tempdir}; fn test_writev() { let mut to_write = Vec::with_capacity(16 * 128); for _ in 0..16 { - let s: String = thread_rng().gen_ascii_chars().take(128).collect(); + let s: String = thread_rng().sample_iter(&Alphanumeric).take(128).collect(); let b = s.as_bytes(); to_write.extend(b.iter().cloned()); } @@ -53,7 +54,7 @@ fn test_writev() { #[test] fn test_readv() { - let s:String = thread_rng().gen_ascii_chars().take(128).collect(); + let s:String = thread_rng().sample_iter(&Alphanumeric).take(128).collect(); let to_write = s.as_bytes().to_vec(); let mut storage = Vec::new(); let mut allocated = 0;