From cfeed5236f365707af602a3c456523da13f04888 Mon Sep 17 00:00:00 2001 From: Marcel Hellwig Date: Mon, 27 Jun 2022 08:40:43 +0200 Subject: [PATCH] resolve concerns --- tests/quick.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/quick.rs b/tests/quick.rs index 58616f7ca..5c73d20a9 100644 --- a/tests/quick.rs +++ b/tests/quick.rs @@ -258,7 +258,9 @@ where let mut it = get_it(); for _ in 0..(counts.len() - 1) { - assert!(it.next().is_some(), "Iterator shouldn't be finished, may not be deterministic"); + if it.next().is_none() { + panic!("Iterator shouldn't be finished, may not be deterministic"); + } } if it.next().is_none() { @@ -1546,7 +1548,8 @@ quickcheck! { fn counts(nums: Vec) -> TestResult { let counts = nums.iter().counts(); for (&item, &count) in counts.iter() { - if count == 0 { + #[allow(clippy::absurd_extreme_comparisons)] + if count <= 0 { return TestResult::failed(); } if count != nums.iter().filter(|&x| x == item).count() {