@@ -46,7 +46,6 @@ pub trait PoolIndex<T>: BorrowMut<[usize]> {
46
46
where
47
47
T : Clone ;
48
48
49
- #[ inline]
50
49
fn len ( & self ) -> usize {
51
50
self . borrow ( ) . len ( )
52
51
}
@@ -72,10 +71,6 @@ impl<T, const K: usize> PoolIndex<T> for [usize; K] {
72
71
{
73
72
pool. get_array ( * self )
74
73
}
75
-
76
- fn len ( & self ) -> usize {
77
- K
78
- }
79
74
}
80
75
81
76
impl < I , Idx > Clone for CombinationsGeneric < I , Idx >
@@ -132,10 +127,8 @@ impl<I: Iterator, Idx: PoolIndex<I::Item>> CombinationsGeneric<I, Idx> {
132
127
pool,
133
128
first,
134
129
} = 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 ( ) )
139
132
}
140
133
141
134
/// 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> {
189
182
}
190
183
191
184
/// 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 >
193
186
where
194
187
I : Iterator ,
195
188
I :: Item : Clone ,
@@ -281,7 +274,7 @@ impl<I: Iterator> Combinations<I> {
281
274
}
282
275
283
276
/// 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 > {
285
278
let k = indices. len ( ) ;
286
279
if n < k {
287
280
Some ( 0 )
0 commit comments