summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-08-29 14:06:41 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-08-30 08:29:28 -0400
commit11896647e6a31122ee8c015e2cc6093e448029d6 (patch)
tree3bf8d4532c2079bc710ee182949d20f58219114c /src
parent902e6e2ee6542ce63932dca78ea27130be5d8948 (diff)
Downgrading tokio to registry version.
Prep for rustls.
Diffstat (limited to 'src')
-rw-r--r--src/fs.rs5
-rw-r--r--src/main.rs1
2 files changed, 3 insertions, 3 deletions
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::<u32>();
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;