diff --git a/Cargo.toml b/Cargo.toml index 433d823..90e9b40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,8 +29,7 @@ nom = { version = "6", optional = true } criterion = "0.3" futures-executor = "0.3.4" hex = "0.4" -rand = "0.7" -quickcheck = "0.9" +quickcheck = "1" [[bench]] name = "benchmark" diff --git a/src/codec.rs b/src/codec.rs index 1576a88..606dcc0 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -103,7 +103,7 @@ pub struct UviBytes { varint_codec: Uvi, /// number of bytes expected in the current frame (for decoding only) len: Option, - // maximum permitted number of bytes per frame + /// maximum permitted number of bytes per frame max: usize, _ty: PhantomData } diff --git a/tests/identity.rs b/tests/identity.rs index 2924de7..1d31b43 100644 --- a/tests/identity.rs +++ b/tests/identity.rs @@ -105,7 +105,7 @@ fn various() { #[test] fn identity_codec() { use bytes::{Bytes, BytesMut}; - use quickcheck::StdThreadGen; + use quickcheck::Gen; use tokio_util::codec::{Encoder, Decoder}; use unsigned_varint::codec::UviBytes; @@ -118,7 +118,7 @@ fn identity_codec() { input == codec.decode(&mut buffer).expect("Ok").expect("Some").freeze() } - QuickCheck::with_gen(StdThreadGen::new(512 * 1024)) + QuickCheck::new().gen(Gen::new(512 * 1024)) .quickcheck(prop as fn(Vec) -> bool) } diff --git a/tests/io.rs b/tests/io.rs index 3ed5624..1ca9f33 100644 --- a/tests/io.rs +++ b/tests/io.rs @@ -18,7 +18,6 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. use quickcheck::{Arbitrary, Gen}; -use rand::Rng; use unsigned_varint::encode; #[cfg(feature = "std")] @@ -107,8 +106,8 @@ impl RandomUvi { } impl Arbitrary for RandomUvi { - fn arbitrary(g: &mut G) -> Self { - let n: u128 = g.gen(); + fn arbitrary(g: &mut Gen) -> Self { + let n: u128 = Arbitrary::arbitrary(g); match n % 6 { 0 => { let mut b = encode::u8_buffer();