Remove unzip() SizeHint hack
This was using an invalid iterator so is likely to end with buggy behaviour. It also doesn't even benefit many type in std including Vec so removing it shouldn't cause any problems.
This commit is contained in:
parent
763f9234b0
commit
02f9be8524
1 changed files with 0 additions and 15 deletions
|
@ -11,7 +11,6 @@
|
|||
use clone::Clone;
|
||||
use cmp::{Ord, PartialOrd, PartialEq, Ordering};
|
||||
use default::Default;
|
||||
use marker;
|
||||
use num::{Zero, One};
|
||||
use ops::{Add, FnMut, Mul};
|
||||
use option::Option::{self, Some, None};
|
||||
|
@ -1747,23 +1746,9 @@ pub trait Iterator {
|
|||
FromB: Default + Extend<B>,
|
||||
Self: Sized + Iterator<Item=(A, B)>,
|
||||
{
|
||||
struct SizeHint<A>(usize, Option<usize>, marker::PhantomData<A>);
|
||||
impl<A> Iterator for SizeHint<A> {
|
||||
type Item = A;
|
||||
|
||||
fn next(&mut self) -> Option<A> { None }
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
(self.0, self.1)
|
||||
}
|
||||
}
|
||||
|
||||
let (lo, hi) = self.size_hint();
|
||||
let mut ts: FromA = Default::default();
|
||||
let mut us: FromB = Default::default();
|
||||
|
||||
ts.extend(SizeHint(lo, hi, marker::PhantomData));
|
||||
us.extend(SizeHint(lo, hi, marker::PhantomData));
|
||||
|
||||
for (t, u) in self {
|
||||
ts.extend(Some(t));
|
||||
us.extend(Some(u));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue