File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -365,15 +365,13 @@ where
365
365
}
366
366
367
367
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
368
- let has_cur = matches ! ( self . a_cur, Some ( Some ( _) ) ) as usize ;
369
368
// Not ExactSizeIterator because size may be larger than usize
370
- let ( b_min, b_max) = self . b . size_hint ( ) ;
371
-
372
369
// Compute a * b_orig + b for both lower and upper bound
373
- size_hint:: add (
374
- size_hint:: mul ( self . a . size_hint ( ) , self . b_orig . size_hint ( ) ) ,
375
- ( b_min * has_cur, b_max. map ( move |x| x * has_cur) ) ,
376
- )
370
+ let mut sh = size_hint:: mul ( self . a . size_hint ( ) , self . b_orig . size_hint ( ) ) ;
371
+ if matches ! ( self . a_cur, Some ( Some ( _) ) ) {
372
+ sh = size_hint:: add ( sh, self . b . size_hint ( ) ) ;
373
+ }
374
+ sh
377
375
}
378
376
379
377
fn fold < Acc , G > ( self , mut accum : Acc , mut f : G ) -> Acc
You can’t perform that action at this time.
0 commit comments