Skip to content

Commit 61c7737

Browse files
committed
fix clippy::manual_assert in tests
1 parent c458438 commit 61c7737

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

tests/adaptors_no_collect.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ impl Iterator for PanickingCounter {
1111
fn next(&mut self) -> Option<Self::Item> {
1212
self.curr += 1;
1313

14-
if self.curr == self.max {
15-
panic!(
16-
"Input iterator reached maximum of {} suggesting collection by adaptor",
17-
self.max
18-
);
19-
}
14+
assert_ne!(
15+
self.curr, self.max,
16+
"Input iterator reached maximum of {} suggesting collection by adaptor",
17+
self.max
18+
);
2019

2120
Some(())
2221
}
@@ -44,4 +43,4 @@ fn combinations_no_collect() {
4443
#[test]
4544
fn combinations_with_replacement_no_collect() {
4645
no_collect_test(|iter| iter.combinations_with_replacement(5))
47-
}
46+
}

tests/quick.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,7 @@ where
258258
let mut it = get_it();
259259

260260
for _ in 0..(counts.len() - 1) {
261-
if it.next().is_none() {
262-
panic!("Iterator shouldn't be finished, may not be deterministic");
263-
}
261+
assert!(it.next().is_some(), "Iterator shouldn't be finished, may not be deterministic");
264262
}
265263

266264
if it.next().is_none() {

0 commit comments

Comments
 (0)