Skip to content

Commit b7a953e

Browse files
committed
FIX: Make internal iterator types and functions pub(crate)
These `pub` here actually predate the pub(crate) feature, and they should just be `pub(crate)` or lower since they are unreachable outside the crate.
1 parent 702de70 commit b7a953e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/iterators/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::slice::{self, Iter as SliceIter, IterMut as SliceIterMut};
3434
/// Base for iterators over all axes.
3535
///
3636
/// Iterator element type is `*mut A`.
37-
pub struct Baseiter<A, D> {
37+
pub(crate) struct Baseiter<A, D> {
3838
ptr: *mut A,
3939
dim: D,
4040
strides: D,
@@ -321,7 +321,7 @@ pub struct Iter<'a, A, D> {
321321
}
322322

323323
/// Counted read only iterator
324-
pub struct ElementsBase<'a, A, D> {
324+
pub(crate) struct ElementsBase<'a, A, D> {
325325
inner: Baseiter<A, D>,
326326
life: PhantomData<&'a A>,
327327
}
@@ -338,7 +338,7 @@ pub struct IterMut<'a, A, D> {
338338
/// An iterator over the elements of an array.
339339
///
340340
/// Iterator element type is `&'a mut A`.
341-
pub struct ElementsBaseMut<'a, A, D> {
341+
pub(crate) struct ElementsBaseMut<'a, A, D> {
342342
inner: Baseiter<A, D>,
343343
life: PhantomData<&'a mut A>,
344344
}
@@ -767,7 +767,7 @@ where
767767
}
768768

769769
#[derive(Debug)]
770-
pub struct AxisIterCore<A, D> {
770+
struct AxisIterCore<A, D> {
771771
/// Index along the axis of the value of `.next()`, relative to the start
772772
/// of the axis.
773773
index: Ix,
@@ -1445,7 +1445,7 @@ send_sync_read_write!(ElementsBaseMut);
14451445
///
14461446
/// The iterator must produce exactly the number of elements it reported or
14471447
/// diverge before reaching the end.
1448-
pub unsafe trait TrustedIterator {}
1448+
pub(crate) unsafe trait TrustedIterator {}
14491449

14501450
use crate::indexes::IndicesIterF;
14511451
use crate::iter::IndicesIter;
@@ -1470,15 +1470,15 @@ unsafe impl<D> TrustedIterator for IndicesIterF<D> where D: Dimension {}
14701470
unsafe impl<A, D> TrustedIterator for IntoIter<A, D> where D: Dimension {}
14711471

14721472
/// Like Iterator::collect, but only for trusted length iterators
1473-
pub fn to_vec<I>(iter: I) -> Vec<I::Item>
1473+
pub(crate) fn to_vec<I>(iter: I) -> Vec<I::Item>
14741474
where
14751475
I: TrustedIterator + ExactSizeIterator,
14761476
{
14771477
to_vec_mapped(iter, |x| x)
14781478
}
14791479

14801480
/// Like Iterator::collect, but only for trusted length iterators
1481-
pub fn to_vec_mapped<I, F, B>(iter: I, mut f: F) -> Vec<B>
1481+
pub(crate) fn to_vec_mapped<I, F, B>(iter: I, mut f: F) -> Vec<B>
14821482
where
14831483
I: TrustedIterator + ExactSizeIterator,
14841484
F: FnMut(I::Item) -> B,

0 commit comments

Comments
 (0)