Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ zerocopy = ["fs", "uio"]
[dev-dependencies]
assert-impl = "0.1"
parking_lot = "0.12"
rand = "0.8"
rand = "0.9"
tempfile = "3.7.1"
semver = "1.0.7"
nix = { path = ".", features = ["acct", "aio", "dir", "env", "event", "fanotify",
Expand Down
4 changes: 2 additions & 2 deletions test/sys/test_sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use nix::sys::socket::{
getsockopt, setsockopt, socket, sockopt, AddressFamily, SockFlag,
SockProtocol, SockType,
};
use rand::{thread_rng, Rng};
use rand::{rng, Rng};
use std::os::unix::io::{AsRawFd, FromRawFd, OwnedFd};

// NB: FreeBSD supports LOCAL_PEERCRED for SOCK_SEQPACKET, but OSX does not.
Expand Down Expand Up @@ -124,7 +124,7 @@ fn test_so_buf() {
SockProtocol::Udp,
)
.unwrap();
let bufsize: usize = thread_rng().gen_range(4096..131_072);
let bufsize: usize = rng().random_range(4096..131_072);
setsockopt(&fd, sockopt::SndBuf, &bufsize).unwrap();
let actual = getsockopt(&fd, sockopt::SndBuf).unwrap();
assert!(actual >= bufsize);
Expand Down
12 changes: 6 additions & 6 deletions test/sys/test_uio.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use nix::sys::uio::*;
use nix::unistd::*;
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
use rand::distr::Alphanumeric;
use rand::{rng, Rng};
use std::fs::OpenOptions;
use std::io::IoSlice;
use std::{cmp, iter};
Expand All @@ -19,7 +19,7 @@ use tempfile::tempfile;
fn test_writev() {
let mut to_write = Vec::with_capacity(16 * 128);
for _ in 0..16 {
let s: String = thread_rng()
let s: String = rng()
.sample_iter(&Alphanumeric)
.map(char::from)
.take(128)
Expand All @@ -35,7 +35,7 @@ fn test_writev() {
let slice_len = if left <= 64 {
left
} else {
thread_rng().gen_range(64..cmp::min(256, left))
rng().random_range(64..cmp::min(256, left))
};
let b = &to_write[consumed..consumed + slice_len];
iovecs.push(IoSlice::new(b));
Expand All @@ -61,7 +61,7 @@ fn test_writev() {
#[test]
#[cfg(not(target_os = "redox"))]
fn test_readv() {
let s: String = thread_rng()
let s: String = rng()
.sample_iter(&Alphanumeric)
.map(char::from)
.take(128)
Expand All @@ -74,7 +74,7 @@ fn test_readv() {
let vec_len = if left <= 64 {
left
} else {
thread_rng().gen_range(64..cmp::min(256, left))
rng().random_range(64..cmp::min(256, left))
};
let v: Vec<u8> = iter::repeat(0u8).take(vec_len).collect();
storage.push(v);
Expand Down