File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,11 @@ impl Iterator for PanickingCounter {
11
11
fn next ( & mut self ) -> Option < Self :: Item > {
12
12
self . curr += 1 ;
13
13
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
+ ) ;
20
19
21
20
Some ( ( ) )
22
21
}
@@ -44,4 +43,4 @@ fn combinations_no_collect() {
44
43
#[ test]
45
44
fn combinations_with_replacement_no_collect ( ) {
46
45
no_collect_test ( |iter| iter. combinations_with_replacement ( 5 ) )
47
- }
46
+ }
Original file line number Diff line number Diff line change @@ -258,9 +258,7 @@ where
258
258
let mut it = get_it ( ) ;
259
259
260
260
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" ) ;
264
262
}
265
263
266
264
if it. next ( ) . is_none ( ) {
You can’t perform that action at this time.
0 commit comments