Skip to content

Commit

Permalink
Update to rand 0.5 crate
Browse files Browse the repository at this point in the history
This avoids having both 0.4 and 0.5 (required by tempfile)
  • Loading branch information
bachp committed Sep 4, 2018
1 parent 0b9ea13 commit d135765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions test/sys/test_uio.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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());
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d135765

Please sign in to comment.