summaryrefslogtreecommitdiffstats
path: root/tokio-fs
diff options
context:
space:
mode:
authorKazuyoshi Kato <kato.kazuyoshi@gmail.com>2018-11-10 18:35:38 -0800
committerToby Lawrence <tobz@users.noreply.github.com>2018-11-10 21:35:38 -0500
commitd246964bdffd133e1f2bae413c6a94af13501574 (patch)
tree2e26d16909d32f135e818e124eed5d8ecd8696bb /tokio-fs
parente700607554b3af4e681ea5fa6346b72cffe35185 (diff)
fs: gen_ascii_chars has been deprecated (#735)
Use sample_iter() instead.
Diffstat (limited to 'tokio-fs')
-rw-r--r--tokio-fs/tests/file.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/tokio-fs/tests/file.rs b/tokio-fs/tests/file.rs
index b92f1355..2e1a44a1 100644
--- a/tokio-fs/tests/file.rs
+++ b/tokio-fs/tests/file.rs
@@ -12,7 +12,7 @@ use tokio_threadpool::*;
use futures::Future;
use futures::future::poll_fn;
use futures::sync::oneshot;
-use rand::{thread_rng, Rng};
+use rand::{thread_rng, Rng, distributions};
use tempfile::Builder as TmpBuilder;
use std::fs::File as StdFile;
@@ -25,7 +25,8 @@ fn read_write() {
let dir = TmpBuilder::new().prefix("tokio-fs-tests").tempdir().unwrap();
let file_path = dir.path().join("read_write.txt");
- let contents: Vec<u8> = thread_rng().gen_ascii_chars()
+ let contents: Vec<u8> = thread_rng()
+ .sample_iter(&distributions::Alphanumeric)
.take(NUM_CHARS)
.collect::<String>()
.into();