diff options
author | Andrew Gallant <jamslam@gmail.com> | 2018-08-25 09:53:30 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-08-25 10:01:36 -0400 |
commit | 5c5c538601b2dd4d95eab22fd216a3157049c966 (patch) | |
tree | 442ebbf2c31897e7ce0b7449c43fae459cf39f85 | |
parent | bc730d7572896185e2945cb9ed9c0c2b02e1bf46 (diff) |
deps: update to quickcheck 0.7
This also updates the rand crate.
We bump the minimum Rust version to the latest stable, Rust 1.28.0.
See: https://github.com/BurntSushi/ripgrep/issues/1019
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | Cargo.lock | 39 | ||||
-rw-r--r-- | Cargo.toml | 5 | ||||
-rw-r--r-- | src/cmd/sample.rs | 18 | ||||
-rw-r--r-- | tests/tests.rs | 2 |
5 files changed, 49 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml index de44755..fe59389 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,10 +18,10 @@ matrix: env: TARGET=x86_64-unknown-linux-musl # Minimum Rust supported channel. - os: linux - rust: 1.20.0 + rust: 1.28.0 env: TARGET=x86_64-unknown-linux-gnu - os: linux - rust: 1.20.0 + rust: 1.28.0 env: TARGET=x86_64-unknown-linux-musl before_install: @@ -30,6 +30,14 @@ dependencies = [ ] [[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "csv" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -140,10 +148,11 @@ dependencies = [ [[package]] name = "quickcheck" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -175,6 +184,23 @@ dependencies = [ ] [[package]] +name = "rand" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "redox_syscall" version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -326,8 +352,8 @@ dependencies = [ "filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quickcheck 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quickcheck 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", @@ -342,6 +368,7 @@ dependencies = [ "checksum byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "73b5bdfe7ee3ad0b99c9801d58807a9dbc9e09196365b0203853b99889ab3c87" "checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" "checksum chan 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "9af7c487bb99c929ba2715b1a3a7bf45f5062bf5b6eae5d32b292a96c5865172" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum csv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71903184af9960c555e7f3b32ff17390d20ecaaf17d4f18c4a0993f2df8a49e3" "checksum csv-core 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4dd8e6d86f7ba48b4276ef1317edc8cc36167546d8972feb4a2b5fec0b374105" "checksum csv-index 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7b27beef016f9d0d43fd1f6097a469d1ccccd2191888f5dfeb4e7be7dbc8bfc6" @@ -356,10 +383,12 @@ dependencies = [ "checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" -"checksum quickcheck 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c01babc5ffd48a2a83744b3024814bb46dfd4f2a4705ccb44b1b60e644fdcab7" +"checksum quickcheck 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b70118ab610f395b6c68ee9c7443d27b8da7d6d5145e82dc0be6fbe60029da37" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" +"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" +"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" "checksum regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3" "checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b" @@ -9,6 +9,7 @@ repository = "https://github.com/BurntSushi/xsv" readme = "README.md" keywords = ["csv", "tsv", "slice", "command"] license = "Unlicense/MIT" +autotests = false [[bin]] name = "xsv" @@ -34,7 +35,7 @@ csv-index = "0.1.5" docopt = "1" filetime = "0.1" num_cpus = "1.4" -rand = "0.4" +rand = "0.5" regex = "1" serde = "1" serde_derive = "1" @@ -43,5 +44,5 @@ tabwriter = "1" threadpool = "1.3" [dev-dependencies] -quickcheck = { version = "0.6", default-features = false } +quickcheck = { version = "0.7", default-features = false } log = "0.4" diff --git a/src/cmd/sample.rs b/src/cmd/sample.rs index 9c6f8ef..7b14c34 100644 --- a/src/cmd/sample.rs +++ b/src/cmd/sample.rs @@ -1,7 +1,9 @@ use std::io; +use byteorder::{ByteOrder, LittleEndian}; use csv; -use rand::{Rng, SeedableRng, StdRng}; +use rand::{self, Rng, SeedableRng}; +use rand::rngs::StdRng; use CliResult; use config::{Config, Delimiter}; @@ -115,15 +117,13 @@ fn sample_reservoir<R: io::Read>( // Seeding rng let mut rng: StdRng = match seed { - Some(s) => { - SeedableRng::from_seed(&[s][..]) - } None => { - let s = ::rand::thread_rng() - .gen_iter() - .take(256) - .collect::<Vec<usize>>(); - SeedableRng::from_seed(&s[..]) + StdRng::from_rng(rand::thread_rng()).unwrap() + } + Some(seed) => { + let mut buf = [0u8; 32]; + LittleEndian::write_u64(&mut buf, seed as u64); + SeedableRng::from_seed(buf) } }; diff --git a/tests/tests.rs b/tests/tests.rs index db2f3b3..37966bc 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -16,7 +16,7 @@ use std::mem::transmute; use std::ops; use quickcheck::{Arbitrary, Gen, QuickCheck, StdGen, Testable}; -use rand::thread_rng; +use rand::{Rng, thread_rng}; macro_rules! svec[ ($($x:expr),*) => ( |