From 11896647e6a31122ee8c015e2cc6093e448029d6 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 29 Aug 2018 14:06:41 -0400 Subject: Downgrading tokio to registry version. Prep for rustls. --- src/fs.rs | 5 +++-- src/main.rs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/fs.rs b/src/fs.rs index 786c35691..9290d94e5 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -5,7 +5,7 @@ use std::io::Write; use std::path::{Path, PathBuf}; use rand; -use rand::RngCore; +use rand::Rng; pub fn write_file_sync(path: &Path, content: &[u8]) -> std::io::Result<()> { let mut f = File::create(path)?; @@ -23,8 +23,9 @@ pub fn make_temp_dir( Some(ref p) => p.to_path_buf(), None => std::env::temp_dir(), }.join("_"); + let mut rng = rand::thread_rng(); loop { - let unique = rand::thread_rng().next_u32(); + let unique = rng.gen::(); buf.set_file_name(format!("{}{:08x}{}", prefix_, unique, suffix_)); // TODO: on posix, set mode flags to 0o700. let r = create_dir(buf.as_path()); diff --git a/src/main.rs b/src/main.rs index 6a013bea0..a43f62642 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ extern crate rand; extern crate sha1; extern crate tempfile; extern crate tokio; -extern crate tokio_current_thread; extern crate url; #[macro_use] extern crate log; -- cgit v1.2.3