Blob Blame History Raw
From 1f1cd1858c568cbc9b06eaa916850331711c2473 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Sun, 15 Jul 2018 08:37:14 +0200
Subject: [PATCH] deps: update rand to 0.5

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
 examples/multi.rs  | 8 ++++----
 examples/simple.rs | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/multi.rs b/examples/multi.rs
index c6969b2..9860728 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::<u8>();
+        let b = random::<u8>();
         // [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 3cacff6..bb3d34b 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!");
-- 
2.21.0