@@ -46,7 +46,6 @@ pub trait PoolIndex<T>: BorrowMut<[usize]> {
4646 where
4747 T : Clone ;
4848
49- #[ inline]
5049 fn len ( & self ) -> usize {
5150 self . borrow ( ) . len ( )
5251 }
@@ -72,10 +71,6 @@ impl<T, const K: usize> PoolIndex<T> for [usize; K] {
7271 {
7372 pool. get_array ( * self )
7473 }
75-
76- fn len ( & self ) -> usize {
77- K
78- }
7974}
8075
8176impl < I , Idx > Clone for CombinationsGeneric < I , Idx >
@@ -132,10 +127,8 @@ impl<I: Iterator, Idx: PoolIndex<I::Item>> CombinationsGeneric<I, Idx> {
132127 pool,
133128 first,
134129 } = self ;
135- {
136- let n = pool. count ( ) ;
137- ( n, remaining_for ( n, first, indices. borrow ( ) ) . unwrap ( ) )
138- }
130+ let n = pool. count ( ) ;
131+ ( n, remaining_for ( n, first, indices. borrow ( ) ) . unwrap ( ) )
139132 }
140133
141134 /// Initialises the iterator by filling a buffer with elements from the
@@ -189,7 +182,7 @@ impl<I: Iterator, Idx: PoolIndex<I::Item>> CombinationsGeneric<I, Idx> {
189182 }
190183
191184 /// Returns the n-th item or the number of successful steps.
192- pub ( crate ) fn try_nth ( & mut self , n : usize ) -> Result < Idx :: Item , usize >
185+ pub ( crate ) fn try_nth ( & mut self , n : usize ) -> Result < < Self as Iterator > :: Item , usize >
193186 where
194187 I : Iterator ,
195188 I :: Item : Clone ,
@@ -281,7 +274,7 @@ impl<I: Iterator> Combinations<I> {
281274}
282275
283276/// For a given size `n`, return the count of remaining combinations or None if it would overflow.
284- pub ( crate ) fn remaining_for ( n : usize , first : bool , indices : & [ usize ] ) -> Option < usize > {
277+ fn remaining_for ( n : usize , first : bool , indices : & [ usize ] ) -> Option < usize > {
285278 let k = indices. len ( ) ;
286279 if n < k {
287280 Some ( 0 )
0 commit comments