Skip to content

Commit 5971ccc

Browse files
author
Clar Fon
committed
Don't expose ZipImpl to Iterator
1 parent 52b36e2 commit 5971ccc

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/libcore/iter/adapters/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ mod zip;
1313
pub use self::chain::Chain;
1414
pub use self::flatten::{FlatMap, Flatten};
1515
pub use self::zip::Zip;
16-
pub(super) use self::zip::ZipImpl;
1716
pub(crate) use self::zip::TrustedRandomAccess;
1817

1918
/// A double-ended iterator with the direction inverted.

src/libcore/iter/adapters/zip.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pub struct Zip<A, B> {
1919
len: usize,
2020
}
2121
impl<A: Iterator, B: Iterator> Zip<A, B> {
22+
pub(in super::super) fn new(a: A, b: B) -> Zip<A, B> {
23+
ZipImpl::new(a, b)
24+
}
2225
fn super_nth(&mut self, mut n: usize) -> Option<(A::Item, B::Item)> {
2326
while let Some(x) = Iterator::next(self) {
2427
if n == 0 { return Some(x) }
@@ -62,7 +65,7 @@ impl<A, B> DoubleEndedIterator for Zip<A, B> where
6265

6366
// Zip specialization trait
6467
#[doc(hidden)]
65-
pub(in super::super) trait ZipImpl<A, B> {
68+
trait ZipImpl<A, B> {
6669
type Item;
6770
fn new(a: A, b: B) -> Self;
6871
fn next(&mut self) -> Option<Self::Item>;

src/libcore/iter/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ pub use self::adapters::Flatten;
353353
#[unstable(feature = "iter_copied", issue = "57127")]
354354
pub use self::adapters::Copied;
355355

356-
use self::adapters::ZipImpl;
357356
pub(crate) use self::adapters::TrustedRandomAccess;
358357

359358
mod range;

src/libcore/iter/traits/iterator.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use super::super::LoopState;
55
use super::super::{Chain, Cycle, Copied, Cloned, Enumerate, Filter, FilterMap, Fuse};
66
use super::super::{Flatten, FlatMap};
77
use super::super::{Inspect, Map, Peekable, Scan, Skip, SkipWhile, StepBy, Take, TakeWhile, Rev};
8-
use super::super::{Zip, Sum, Product};
9-
use super::super::{FromIterator, ZipImpl};
8+
use super::super::{Zip, Sum, Product, FromIterator};
109

1110
fn _assert_is_object_safe(_: &dyn Iterator<Item=()>) {}
1211

0 commit comments

Comments
 (0)