Skip to content

Commit ac08f60

Browse files
committed
Canonicalize some size_hint
1 parent a273cb8 commit ac08f60

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

src/adaptors/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,7 @@ impl<'a, I, F> Iterator for TakeWhileRef<'a, I, F>
854854
}
855855

856856
fn size_hint(&self) -> (usize, Option<usize>) {
857-
let (_, hi) = self.iter.size_hint();
858-
(0, hi)
857+
(0, self.iter.size_hint().1)
859858
}
860859
}
861860

@@ -887,8 +886,7 @@ impl<I, A> Iterator for WhileSome<I>
887886
}
888887

889888
fn size_hint(&self) -> (usize, Option<usize>) {
890-
let sh = self.iter.size_hint();
891-
(0, sh.1)
889+
(0, self.iter.size_hint().1)
892890
}
893891
}
894892

src/peeking_take_while.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ impl<'a, I, F> Iterator for PeekingTakeWhile<'a, I, F>
104104
}
105105

106106
fn size_hint(&self) -> (usize, Option<usize>) {
107-
let (_, hi) = self.iter.size_hint();
108-
(0, hi)
107+
(0, self.iter.size_hint().1)
109108
}
110109
}
111110

src/process_results_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ impl<'a, I, T, E> Iterator for ProcessResults<'a, I, E>
2828
}
2929

3030
fn size_hint(&self) -> (usize, Option<usize>) {
31-
let (_, hi) = self.iter.size_hint();
32-
(0, hi)
31+
(0, self.iter.size_hint().1)
3332
}
3433
}
3534

src/rciter_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ impl<A, I> Iterator for RcIter<I>
6969
// To work sanely with other API that assume they own an iterator,
7070
// so it can't change in other places, we can't guarantee as much
7171
// in our size_hint. Other clones may drain values under our feet.
72-
let (_, hi) = self.rciter.borrow().size_hint();
73-
(0, hi)
72+
(0, self.rciter.borrow().size_hint().1)
7473
}
7574
}
7675

0 commit comments

Comments
 (0)