summaryrefslogtreecommitdiff
path: root/test/sys
diff options
context:
space:
mode:
authorPascal Bach <pascal.bach@nextrem.ch>2018-08-09 11:57:38 +0200
committerPascal Bach <pascal.bach@nextrem.ch>2018-09-05 21:57:05 +0200
commitda089f874a3234e8a8837f60f4376dc30ca1ef5e (patch)
treea227efffa1304ca59f20ac64d84c2d2c510f660b /test/sys
parentd302e8d278bcd5b10ab7a30a467b5d8e21139ff2 (diff)
downloadnix-da089f874a3234e8a8837f60f4376dc30ca1ef5e.zip
Update to rand 0.5 crate
This avoids having both 0.4 and 0.5 (required by tempfile)
Diffstat (limited to 'test/sys')
-rw-r--r--test/sys/test_uio.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs
index 47f3b468..727194d5 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;