Upgrade quickcheck to 1.0, adjust code, optimizing a slow test

This commit is contained in:
Joakim Frostegård 2021-02-04 19:34:44 +01:00
parent 72ff55ae5d
commit f9626ade57
19 changed files with 78 additions and 74 deletions

View file

@ -60,7 +60,7 @@ impl FromStr for AnnounceEvent {
#[cfg(test)]
impl quickcheck::Arbitrary for InfoHash {
fn arbitrary<G: quickcheck::Gen>(g: &mut G) -> Self {
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
let mut arr = [b'0'; 20];
for byte in arr.iter_mut(){
@ -74,7 +74,7 @@ impl quickcheck::Arbitrary for InfoHash {
#[cfg(test)]
impl quickcheck::Arbitrary for PeerId {
fn arbitrary<G: quickcheck::Gen>(g: &mut G) -> Self {
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
let mut arr = [b'0'; 20];
for byte in arr.iter_mut(){
@ -88,7 +88,7 @@ impl quickcheck::Arbitrary for PeerId {
#[cfg(test)]
impl quickcheck::Arbitrary for AnnounceEvent {
fn arbitrary<G: quickcheck::Gen>(g: &mut G) -> Self {
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
match (bool::arbitrary(g), bool::arbitrary(g)){
(false, false) => Self::Started,
(true, false) => Self::Started,