diff --git a/Cargo.toml b/Cargo.toml index 01356541..ce56af8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,4 +20,4 @@ kernel32-sys = "0.2" termion = "1.4" [dev-dependencies] -rand = "0.3.14" +rand = "0.5" diff --git a/examples/multi.rs b/examples/multi.rs index c6969b28..98607280 100644 --- a/examples/multi.rs +++ b/examples/multi.rs @@ -1,6 +1,6 @@ extern crate rand; extern crate pbr; -use rand::Rng; +use rand::prelude::*; use pbr::MultiBar; use std::thread; use std::time::Duration; @@ -23,7 +23,7 @@ fn main() { pb.tick(); } for _ in 0..20 { - let n = rand::thread_rng().gen_range(0, 100); + let n = thread_rng().gen_range(0, 100); pb.message("Connected: "); thread::sleep(Duration::from_millis(n)); pb.inc(); @@ -49,7 +49,7 @@ fn main() { thread::spawn(move || { for _ in 0..count { pb.inc(); - let n = rand::thread_rng().gen_range(0, 100); + let n = thread_rng().gen_range(0, 100); thread::sleep(Duration::from_millis(n)); } pb.finish(); @@ -64,7 +64,7 @@ fn main() { fn rand_string() -> String { let mut v = Vec::new(); while v.len() < 12 { - let b = rand::random::(); + let b = random::(); // [0-9a-f] if b > 47 && b < 58 || b > 96 && b < 103 { v.push(b); diff --git a/examples/simple.rs b/examples/simple.rs index 3cacff6d..bb3d34b5 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,6 +1,6 @@ extern crate rand; extern crate pbr; -use rand::Rng; +use rand::prelude::*; use pbr::ProgressBar; use std::thread; use std::time::Duration; @@ -11,7 +11,7 @@ fn main() { pb.format("╢▌▌░╟"); for _ in 0..count { pb.inc(); - let n = rand::thread_rng().gen_range(0, 100); + let n = thread_rng().gen_range(0, 100); thread::sleep(Duration::from_millis(n)); } pb.finish_println("done!");