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 50
50
}
51
51
52
52
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 ) ) }
56
54
}
57
55
}
58
56
@@ -107,9 +105,7 @@ where
107
105
}
108
106
109
107
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 ) ) }
113
109
}
114
110
}
115
111
@@ -165,8 +161,6 @@ where
165
161
}
166
162
167
163
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 ) ) }
171
165
}
172
166
}
You can’t perform that action at this time.
0 commit comments