File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
library/core/src/iter/adapters Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 5050 }
5151
5252 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
53- let min = self . last . as_ref ( ) . map ( |_| 1 ) . unwrap_or ( 0 ) ;
54- let max = self . inner . size_hint ( ) . 1 ;
55- ( min, max)
53+ if self . last . is_some ( ) { ( 1 , self . inner . size_hint ( ) . 1 ) } else { ( 0 , Some ( 0 ) ) }
5654 }
5755}
5856
@@ -107,9 +105,7 @@ where
107105 }
108106
109107 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
110- let min = self . last . as_ref ( ) . map ( |_| 1 ) . unwrap_or ( 0 ) ;
111- let max = self . inner . size_hint ( ) . 1 ;
112- ( min, max)
108+ if self . last . is_some ( ) { ( 1 , self . inner . size_hint ( ) . 1 ) } else { ( 0 , Some ( 0 ) ) }
113109 }
114110}
115111
@@ -165,8 +161,6 @@ where
165161 }
166162
167163 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
168- let min = self . last . as_ref ( ) . map ( |_| 1 ) . unwrap_or ( 0 ) ;
169- let max = self . inner . size_hint ( ) . 1 ;
170- ( min, max)
164+ if self . last . is_some ( ) { ( 1 , self . inner . size_hint ( ) . 1 ) } else { ( 0 , Some ( 0 ) ) }
171165 }
172166}
You can’t perform that action at this time.
0 commit comments