Skip to content

Commit

Permalink
Merge pull request #72 from ignatenkobrain/master
Browse files Browse the repository at this point in the history
deps: update rand to 0.5
  • Loading branch information
a8m committed Jul 15, 2018
2 parents bff135f + 1f1cd18 commit 9c68ea3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ kernel32-sys = "0.2"
termion = "1.4"

[dev-dependencies]
rand = "0.3.14"
rand = "0.5"
8 changes: 4 additions & 4 deletions examples/multi.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions examples/simple.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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!");
Expand Down

0 comments on commit 9c68ea3

Please sign in to comment.