File tree Expand file tree Collapse file tree 5 files changed +5
-8
lines changed Expand file tree Collapse file tree 5 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ where
123123 /// Returns true if iteration has started and has not yet finished; false
124124 /// otherwise.
125125 fn in_progress ( & self ) -> bool {
126- self . 0 . last ( ) . map_or ( false , |last| last . in_progress ( ) )
126+ self . 0 . last ( ) . map_or ( false , MultiProductIter :: in_progress)
127127 }
128128}
129129
Original file line number Diff line number Diff line change 7676 let inner_hint = |inner : & Option < T :: IntoIter > | {
7777 inner
7878 . as_ref ( )
79- . map ( Iterator :: size_hint)
80- . unwrap_or ( ( 0 , Some ( 0 ) ) )
79+ . map_or ( ( 0 , Some ( 0 ) ) , Iterator :: size_hint)
8180 } ;
8281 let inner_front = inner_hint ( & self . inner_front ) ;
8382 let inner_back = inner_hint ( & self . inner_back ) ;
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ where
112112 if client < self . oldest_buffered_group {
113113 return None ;
114114 }
115- let elt = self . buffer . get_mut ( bufidx) . and_then ( |queue| queue . next ( ) ) ;
115+ let elt = self . buffer . get_mut ( bufidx) . and_then ( Iterator :: next) ;
116116 if elt. is_none ( ) && client == self . oldest_buffered_group {
117117 // FIXME: VecDeque is unfortunately not zero allocation when empty,
118118 // so we do this job manually.
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ where
226226 #[ allow( deprecated) ] //TODO: once msrv hits 1.51. replace `fold1` with `reduce`
227227 self . heap
228228 . iter ( )
229- . map ( |i| i . size_hint ( ) )
229+ . map ( HeadTail :: size_hint)
230230 . fold1 ( size_hint:: add)
231231 . unwrap_or ( ( 0 , Some ( 0 ) ) )
232232 }
Original file line number Diff line number Diff line change @@ -11,9 +11,7 @@ use std::iter::FusedIterator;
1111#[ must_use = "iterator adaptors are lazy and do nothing unless consumed" ]
1212pub struct UniqueBy < I : Iterator , V , F > {
1313 iter : I ,
14- // Use a Hashmap for the Entry API in order to prevent hashing twice.
15- // This can maybe be replaced with a HashSet once `get_or_insert_with`
16- // or a proper Entry API for Hashset is stable and meets this msrv
14+ // see comment for `allow(clippy::zero_sized_map_values)` for reasoning
1715 used : HashMap < V , ( ) > ,
1816 f : F ,
1917}
You can’t perform that action at this time.
0 commit comments