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 {
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]
4544fn combinations_with_replacement_no_collect ( ) {
4645 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
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 ( ) {
You can’t perform that action at this time.
0 commit comments