diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fs.rs | 5 | ||||
-rw-r--r-- | src/main.rs | 1 |
2 files changed, 3 insertions, 3 deletions
@@ -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; |