mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 09:31:20 +00:00
build(deps): Bump rand to 0.8 and quickcheck to 1 (#2857)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io> Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -1623,8 +1623,7 @@ mod tests {
|
||||
use libp2p_core::multiaddr::multiaddr;
|
||||
use libp2p_core::transport::TransportEvent;
|
||||
use libp2p_core::Endpoint;
|
||||
use quickcheck::{quickcheck, Arbitrary, Gen, QuickCheck};
|
||||
use rand::Rng;
|
||||
use quickcheck::*;
|
||||
|
||||
// Test execution state.
|
||||
// Connection => Disconnecting => Connecting.
|
||||
@ -2047,8 +2046,8 @@ mod tests {
|
||||
struct DialConcurrencyFactor(NonZeroU8);
|
||||
|
||||
impl Arbitrary for DialConcurrencyFactor {
|
||||
fn arbitrary<G: Gen>(g: &mut G) -> Self {
|
||||
Self(NonZeroU8::new(g.gen_range(1, 11)).unwrap())
|
||||
fn arbitrary(g: &mut Gen) -> Self {
|
||||
Self(NonZeroU8::new(g.gen_range(1..11)).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
@ -2121,7 +2120,7 @@ mod tests {
|
||||
fn max_outgoing() {
|
||||
use rand::Rng;
|
||||
|
||||
let outgoing_limit = rand::thread_rng().gen_range(1, 10);
|
||||
let outgoing_limit = rand::thread_rng().gen_range(1..10);
|
||||
|
||||
let limits = ConnectionLimits::default().with_max_pending_outgoing(Some(outgoing_limit));
|
||||
let mut network = new_test_swarm::<_, ()>(DummyConnectionHandler {
|
||||
@ -2169,14 +2168,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn max_established_incoming() {
|
||||
use rand::Rng;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct Limit(u32);
|
||||
|
||||
impl Arbitrary for Limit {
|
||||
fn arbitrary<G: Gen>(g: &mut G) -> Self {
|
||||
Self(g.gen_range(1, 10))
|
||||
fn arbitrary(g: &mut Gen) -> Self {
|
||||
Self(g.gen_range(1..10))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user